-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Use ReactModal for search box #1548
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1548 +/- ##
=========================================
Coverage ? 20.88%
=========================================
Files ? 241
Lines ? 5258
Branches ? 648
=========================================
Hits ? 1098
Misses ? 3660
Partials ? 500
Continue to review full report at Codecov.
|
// remove current focus on opening to prevent firing 'enter' keyDowns on it when modal closes | ||
if (this.props.showSearchBox && !prevProps.showSearchBox && document.activeElement) { | ||
document.activeElement.blur(); | ||
} |
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.
This can be removed if and when reactjs/react-modal#464 resolves
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.
Good intel - might be worth dropping that in here as a comment?
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.
Right, will do
Thanks, this looks really good! I want to test it locally before I'll merge. NOT TO SELF: I should really setup automatic example deployment |
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.
Awesome!
Tested locally ✅
Issue: #871
What I did
Wrapped search box in ReactModal
How to test
Open search with
⌘ ⇧ P
. Close it with Esc key or a click outside of the box