-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Components: Stop using react-click-outside
as a dependency
#16878
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gziolo
added
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Feature] UI Components
Impacts or related to the UI component system
[Type] Code Quality
Issues or PRs that relate to code quality
[Package] Components
/packages/components
labels
Aug 2, 2019
gziolo
requested review from
ajitbohra,
chrisvanpatten,
jorgefilipecosta,
talldan and
youknowriad
as code owners
August 2, 2019 09:58
jorgefilipecosta
approved these changes
Aug 8, 2019
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.
Works well in my tests 👍
Thanks for doing this @gziolo! ❤️ |
getdave
added a commit
that referenced
this pull request
Aug 15, 2019
… focus Previously there was no check to see whether the blur event occured within the wrapped component. If it occurs within then we do not want to trigger the `handleFocusOutside` callback because (by definition) the focus has not moved outside the wrapped element. This may have been a regression introduced in #16878
Merged
5 tasks
getdave
added a commit
that referenced
this pull request
Aug 20, 2019
… `withFocusOutside` HOC (#17051) * Adds check to determine whether event occured within element trapping focus Previously there was no check to see whether the blur event occured within the wrapped component. If it occurs within then we do not want to trigger the `handleFocusOutside` callback because (by definition) the focus has not moved outside the wrapped element. This may have been a regression introduced in #16878 * Fix handling blur event when document is not actually focused Previously we fixed the wrong problem. The actual issue is that previously we were handling document blur events as true “focus outside” events when in fact they should be ignored as if the document is not focused then presumably the user did not intent the blur. * Update to test for document loss of focus scenario
donmhico
pushed a commit
to donmhico/gutenberg
that referenced
this pull request
Aug 27, 2019
… `withFocusOutside` HOC (WordPress#17051) * Adds check to determine whether event occured within element trapping focus Previously there was no check to see whether the blur event occured within the wrapped component. If it occurs within then we do not want to trigger the `handleFocusOutside` callback because (by definition) the focus has not moved outside the wrapped element. This may have been a regression introduced in WordPress#16878 * Fix handling blur event when document is not actually focused Previously we fixed the wrong problem. The actual issue is that previously we were handling document blur events as true “focus outside” events when in fact they should be ignored as if the document is not focused then presumably the user did not intent the blur. * Update to test for document loss of focus scenario
gziolo
added a commit
that referenced
this pull request
Aug 29, 2019
gziolo
pushed a commit
that referenced
this pull request
Aug 29, 2019
… `withFocusOutside` HOC (#17051) * Adds check to determine whether event occured within element trapping focus Previously there was no check to see whether the blur event occured within the wrapped component. If it occurs within then we do not want to trigger the `handleFocusOutside` callback because (by definition) the focus has not moved outside the wrapped element. This may have been a regression introduced in #16878 * Fix handling blur event when document is not actually focused Previously we fixed the wrong problem. The actual issue is that previously we were handling document blur events as true “focus outside” events when in fact they should be ignored as if the document is not focused then presumably the user did not intent the blur. * Update to test for document loss of focus scenario
gziolo
added a commit
that referenced
this pull request
Aug 29, 2019
gziolo
pushed a commit
that referenced
this pull request
Aug 29, 2019
… `withFocusOutside` HOC (#17051) * Adds check to determine whether event occured within element trapping focus Previously there was no check to see whether the blur event occured within the wrapped component. If it occurs within then we do not want to trigger the `handleFocusOutside` callback because (by definition) the focus has not moved outside the wrapped element. This may have been a regression introduced in #16878 * Fix handling blur event when document is not actually focused Previously we fixed the wrong problem. The actual issue is that previously we were handling document blur events as true “focus outside” events when in fact they should be ignored as if the document is not focused then presumably the user did not intent the blur. * Update to test for document loss of focus scenario
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] UI Components
Impacts or related to the UI component system
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Components
/packages/components
[Type] Code Quality
Issues or PRs that relate to code quality
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Follow-up for #14851.
This PR addresses my comment from one of the PRs merged this week:
This allows us to get rid of
react-click-outside
dependency from the repository in favor of our own HOCwithFocusOutside
.How has this been tested?
Open one of the modals from More Menu:
Make sure it closes when you mouse-click outside of the modal.
Types of changes
Checklist: