-
Notifications
You must be signed in to change notification settings - Fork 536
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
Overlay: Attach escape handler to overlay container #1824
Conversation
🦋 Changeset detectedLatest commit: c6294a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
…/react into siddharth/nested-overlay-handlers
@@ -38,16 +38,24 @@ function handleEscape(event: KeyboardEvent) { | |||
* @param callbackDependencies {React.DependencyList} The dependencies of the given | |||
* `onEscape` callback for memoization. Omit this param if the callback is already | |||
* memoized. See `React.useCallback` for more info on memoization. | |||
* | |||
* @param containerRef {React.RefObject<HTMLElement>} The overlay element to attach the |
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.
❤️ great idea
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.
🙌 amazing @siddharthkp - thanks for fixing this.
Out of curiosity, did you test the canary on memex and verify this works? |
Yes, but the solution isn't ideal. You would have to add Update: done! and tested with memex and it works well! We should should test the release branch with memex nicely for this one! |
…/react into siddharth/nested-overlay-handlers
This reverts commit 4eab65e.
Hitting
Escape
on Overlays does not bubble up anymore.Fixes #1802
Screenshots
Explainer: (tiny update on video: stopPropagation is now part of Overlay, you don't have to pass it manually) https://www.loom.com/share/962646dc566a41329c5d660c932ba985
Merge checklist