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

Hide search suggestion on clicking outside search field #3758

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joonmo-you
Copy link

The current behavior, as @gaearon mentioned here, allows the search suggestion open even when clicking outside the search field. Implementing an event handler for blurring would resolve this issue temporarily. Additionally, I concur with the suggestion to evolve the search suggestion into a popover.

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

Doing this on blur wouldn't be sufficient because that would break it for keyboard users. Need to be able to navigate the list with keyboard without having it disappear.

@joonmo-you
Copy link
Author

Doing this on blur wouldn't be sufficient because that would break it for keyboard users. Need to be able to navigate the list with keyboard without having it disappear.

I was naive, overlooking users who navigate using a keyboard. I resolved the issue by addressing two scenarios: Firstly, ensuring the search field remains open when focused elements remain within it. Secondly, closing the search field when focus shifts outside of it, either by clicking elsewhere or navigating away using the keyboard.

@joonmo-you joonmo-you requested a review from gaearon April 30, 2024 23:16
@joonmo-you
Copy link
Author

2024-05-01.9.11.46.mov

@zidanegimiga
Copy link

Hey @joonmo-you, were you also adding user's search history there. Referencing issue #3859

@joonmo-you
Copy link
Author

Hey @joonmo-you, were you also adding user's search history there. Referencing issue #3859

I've just been through the issue you referred to. I am not sure the issue should be discussed here. I think the features related to search history would be better addressed separately.

@pfrazee
Copy link
Collaborator

pfrazee commented May 7, 2024

Thanks so much @joonmo-you for handling the requested change. It seems to work exactly right. @gaearon you good w/this?

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.

4 participants