-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiComboBox, EuiPopover] Update esc
logic
#4336
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_4336/ |
One other case to handle (which wasn't listed in #4306) - something about esc in a popover within a flyout closes the popover. I modified expression.js to the following to reproduce:
|
Updated to fix. Should be a more broadly applicable update. |
esc
logicesc
logic
Preview documentation changes for this PR: https://eui.elastic.co/pr_4336/ |
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.
Tested the various problem states locally, everything looks good 👍
Needs a changelog before merging.
Preview documentation changes for this PR: https://eui.elastic.co/pr_4336/ |
Summary
Fixes #4306, in which an EuiComboBox inside an EuiPopover would close both the options list and the popover when hitting escape. Adds additional logic to the key press handler.
The reason for the change is the move to having
react-focus-on
(via EuiFocusTrap) handle escape (previously EuiFocusTrap had its own logic).react-focus-on
attaches theonKeyDown
event to thedocument
and uses!event.defaultPrevented
as its prevention logic.Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Props have proper autodocs- [ ] Added documentation- [ ] Checked Code Sandbox works for the any docs examples- [ ] Added or updated jest tests