-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiFlyout] Enable shards
for scoping element clicks; Optionally delay close event
#5860
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
shards
for scoping element clicksshards
for scoping element clicks; Optionally delay close event
Is there any chance you can take a before/after screencap of the behavior or QA steps? Honestly I'm still not able to repro whatever behavior y'all were seeing on the Elastic docs, not sure if it's because I'm on Firefox. edit: oh derp, it's clicking the toggle/hamburger button to close 🤪 |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
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.
A few more testing comments, hopefully my last! 🤞
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.
Thanks for responding so quickly to my millions of nits! I have some super small prop documentation suggestions, but otherwise this definitely fixes the issue and looks good to me
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
Thanks, @constancecchen; helpful as always! |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5860/ |
Summary
#5810 changed the mechanism by which outside clicks are handled in
EuiFlyout
. The new behavior is more correct, but conflicts with specific cases where outside clicks were previously not truly considered "outside" despite happening on an external element.EuiCollapsibleNav
implementing the Elastic pattern is the clearest case of this.Two solutions to the problem:
shards
prop fromreact-focus-on
to specify that certain elements should be considered as a part of theEuiFlyout
. In the case ofEuiCollapsibleNav
that means the element passed to thebutton
prop, which now automatically gets added to the shards array.EuiFocusTrap
already accepted theshards
prop by way of...rest
.EuiFocusTrap
untilmouseup
. This give the proper button time to work and is unnoticeable for normal outside click events.Before
Screen.Recording.2022-05-03.at.1.03.28.PM.mov
After
Screen.Recording.2022-05-03.at.1.03.51.PM.mov
Checklist