-
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
fix(tool_tip): stop propagation on escape key down #8140
base: main
Are you sure you want to change the base?
fix(tool_tip): stop propagation on escape key down #8140
Conversation
98a69dd
to
7068ec9
Compare
a4d77c5
to
3bcd2b5
Compare
3bcd2b5
to
ba8708d
Compare
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 LGTM (awesome work with the E2E test!) - but I'll defer to @mgadewoll for any final comments since I believe she solved a similar bug/issue recently. My only other thought is we might also want to either QA or write a test for the following other focus trap components:
- modals
- popovers
- various fullscreen modes (EuiDataGrid fullscreen, EuiImage fullscreen, EuiCodeBlock fullscreen(?) - not sure that last one can even have a tooltip)
Thanks for the great suggestion, Cee! 🌈 I focused so much on fixing that one test case I forgot about the other overlay elements that might suffer the same issue. I updated the description with the screen recordings from the manual QA. One doubt I have - is the If we agree to add the automated tests after all, I'll work on that first thing Monday! |
ba8708d
to
7acdd8b
Compare
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
I'm fine with skipping the automated Cypress tests for each focus trap use case - flyouts are likely our biggest use-case in any case. EuiDataGrid might be the second most likely use-case in production. I'm also fine with manual QA only for the cases I noted, I just want to make sure someone tested it :) It might also be nice for future devs to add an inline comment next to the flyout Cypress test noting which other edge cases to manually QA. |
Summary
When we have
EuiIconTip
(consequently,EuiTooltip
) withinEuiFlyout
and with the tooltip open we click "Escape" key, the flyout gets closed. The reason is, the escape keydown event is propagated from the tooltip and captured by the flyout as its parent. Simpleevent.stopPropagation()
insideEuiTooltip
seemed to do the trick.closes #8130
QA
Test path:
yarn storybook
.EuiFlyout
.EuiFlyoutBody
to contain aEuiToolTip
as children.Screen.Recording.2024-11-14.at.15.05.38.mov
Manual QA of other focus-trap elements
EuiModal
Screen.Recording.2024-11-22.at.19.44.54.mov
EuiPopover
Screen.Recording.2024-11-22.at.19.47.32.mov
EuiDataGrid fullscreen
Screen.Recording.2024-11-22.at.19.49.26.mov
General checklist
Checked in both light and dark modes(not applicable)Checked in mobile(not applicable)Added documentation(not applicable)Props have proper autodocs (using(not applicable)@default
if default values are missing) and playground togglesChecked Code Sandbox works for any docs examples(not applicable)Updated visual regression tests(not applicable)If applicable, added the breaking change issue label (and filled out the breaking change checklist)If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)