-
Notifications
You must be signed in to change notification settings - Fork 311
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
Improvement: auto focus search #3271
Comments
I would love to help solve that issue. Would you like assigning it to me? |
I've been investigating this issue and noticed that the text input of Algolia search popup focuses correctly. The problem of this happens when the user presses How to reproduce that:
I suspect that the event listener for If anyone is familiar with how the Algolia search popup is triggered, could you point me to the relevant file/component? Any help would be greatly appreciated! Thanks in advance! |
Hey @gneo0, appreciate you picking this up! The handler for the search is here I believe: clickhouse-docs/src/theme/SearchBar/index.js Lines 22 to 33 in 608e464
It's also used here for the knowledge base page search, but without an event handler.
|
Hey @Blargian , the bug doesn't appear when user clicks on search bar but on |
@gneo0 Apologies, you're right. The event handler itself looks like its defined as part of docsearch. I found it as minified JS only by searching through node_modules for "cmd + k". Unminified reads as:
We import this function in src/theme/SearchBar/index.js and use it here: clickhouse-docs/src/theme/SearchBar/index.js Lines 176 to 182 in 1c5f84e
|
Hmm, great point @Blargian. So this bug should happen from Algolia? What's your thinking about that?? |
Possible but I'm thinking more likely something wrong with the way we are using the component. DocSearch is quite commonly used so I would imagine this issue would be raised already if it was an algolia bug. |
Issue:
When using the Algolia search popup, the search bar does not focus automatically.
Desired behaviour:
the search input should automatically focus when the pop up opens.
steps to reproduce:
The text was updated successfully, but these errors were encountered: