Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix weird search behaviour #361

Merged
merged 3 commits into from
Aug 9, 2024
Merged

Fix weird search behaviour #361

merged 3 commits into from
Aug 9, 2024

Conversation

zanderle
Copy link
Collaborator

@zanderle zanderle commented Aug 8, 2024

Fixes #358
Fixes #357

@zanderle zanderle requested review from humitos and a team as code owners August 8, 2024 14:52
@zanderle zanderle requested a review from agjohnson August 8, 2024 14:52
@zanderle zanderle force-pushed the fix-weird-search-behaviour branch from adda1d4 to f63239d Compare August 8, 2024 14:53
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. I left some small comments. Let me know.

src/search.js Outdated Show resolved Hide resolved
Comment on lines +629 to 630
this.hideRecentSearches = false;
debounce(func, CLEAR_RESULTS_DELAY)();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could confuse users a little bit, since we will show the recent search when we have less than MIN_CHARACTERS_QUERY. I think we should show recent search when the input field is completely empty, instead (e.g. query.length === 0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I've tried this, but felt the behaviour implemented here felt a bit more natural. Have you tried both options? In any case let me know if you want me to change it, no problem at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested it locally as-is and I think it's fine for now. We can change this behavior in the future if we feel it doesn't work well.

Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 💯

@humitos humitos merged commit 9731ec7 into main Aug 9, 2024
4 checks passed
@humitos humitos deleted the fix-weird-search-behaviour branch August 9, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search: it behaves weird 😄 Search: we are showing true in the result list when typing
2 participants