-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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(v2): remove focus on search input when hovering over it #2262
Conversation
@@ -87,8 +94,8 @@ const Search = props => { | |||
className={classnames('search-icon', { | |||
'search-icon-hidden': props.isSearchBarExpanded, | |||
})} | |||
onClick={toggleSearchIconClick} | |||
onKeyDown={toggleSearchIconClick} | |||
onClick={handleSearchIcon} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename handler for consistency.
@@ -77,7 +78,13 @@ const Search = props => { | |||
|
|||
const handleSearchInputBlur = useCallback(() => { | |||
props.handleSearchBarToggle(!props.isSearchBarExpanded); | |||
}, [algoliaLoaded]); | |||
}, [props.isSearchBarExpanded]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix also proper deps.
Deploy preview for docusaurus-2 ready! Built with commit 4b8ca8e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops lol. Thanks for fixing!
Motivation
PR #2188 brought an unpleasant side effect - when you hover over the search field, auto focus occurred on this field.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Check the search input work - when hovering, when focus, also consider mobiles.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)