-
Notifications
You must be signed in to change notification settings - Fork 842
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] Clarify clickOutsideDisables
decision
#4236
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_4236/ |
Ok so from what I can tell the new behavior is:
|
I agree with this. And this behavior existed before this PR and before #4071, anyway. This PR (as it stands now) really only has an impact on non-keyboard users who attempt interact with focusable elements outside the flyout. It prevents cases where their clicks might appear to be blocked/prevented, but with no indication of why. |
The small flyout example states
But it does still trap focus. Either the documentation needs to be changed (aligns with this PR), or the focus trap needs to be disabled (add |
Yes, I would update the example by just removing that bit about the prop also removing focus trap. |
Great, I'll update the example and add some code comments |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4236/ |
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.
Preview documentation changes for this PR: https://eui.elastic.co/pr_4236/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4236/ |
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.
👍 Thank you!
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.
⛵ 🦑
Going to wait to see how #4247 is resolved before merging this. Should be safe, but want to verify |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4236/ |
Summary
#4071 changed the default config of the focus trap in
EuiFlyout
toclickOutsideDisables=false
. This altered behavior slightly:What we see now is that there is no way to exit the focus trap (except for clicking the close 'X') when
ownFocus=false
. For instance, in the "Small flyout, without ownFocus" example, opening the flyout and attempting click the global search input results unexpectedly in the input not gaining focus. This seems odd considering that there is no overlay mask to indicate that elements "under" the flyout are not focusable.I see two options:
clickOutsideDisables={false}
toclickOutsideDisables={!ownFocus}
The return-focus bug is still prevented for
ownFocus=true
and more intuitive behavior returns forownFocus=false
.clickOutsideDisables={false}
, but indicate through documentation that consumers need to add their own logic to close the flyout on outside clicks. This would essentially codify that having an open flyout and expecting to interact with elements outside of the flyout is not supported.This also has implications for #2224, which can be closed by a decision either way (it shows a case of
ownFocus=false
while attempting outside interaction).Note: #4071 has not been released yet, so you need to use local master or the docs preivew in this PR
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 or updated jest tests