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

Use ReactModal for search box #1548

Merged
merged 12 commits into from
Aug 5, 2017
Merged

Use ReactModal for search box #1548

merged 12 commits into from
Aug 5, 2017

Conversation

Hypnosphi
Copy link
Member

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

@codecov
Copy link

codecov bot commented Jul 31, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@cac5401). Click here to learn what that means.
The diff coverage is 44.44%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1548   +/-   ##
=========================================
  Coverage          ?   20.88%           
=========================================
  Files             ?      241           
  Lines             ?     5258           
  Branches          ?      648           
=========================================
  Hits              ?     1098           
  Misses            ?     3660           
  Partials          ?      500
Impacted Files Coverage Δ
lib/ui/src/modules/ui/components/shortcuts_help.js 45.45% <ø> (ø)
lib/ui/src/modules/shortcuts/actions/shortcuts.js 6.25% <0%> (ø)
lib/ui/src/libs/key_events.js 23.25% <0%> (ø)
lib/ui/src/modules/ui/containers/search_box.js 100% <100%> (ø)
lib/ui/src/modules/ui/components/search_box.js 84.37% <60%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cac5401...1852b0e. Read the comment docs.

// 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();
}
Copy link
Member Author

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

Copy link
Member

@atticoos atticoos Jul 31, 2017

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, will do

@ndelangen
Copy link
Member

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

Copy link
Member

@ndelangen ndelangen left a comment

Choose a reason for hiding this comment

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

Awesome!

Tested locally ✅

@ndelangen ndelangen merged commit f36dac3 into master Aug 5, 2017
@ndelangen ndelangen deleted the modal-search-box branch August 5, 2017 08:04
@ndelangen ndelangen added maintenance User-facing maintenance tasks ui labels Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants