-
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
[EuiFocusTrap] Default to not trapping focus across iframes #6908
Conversation
1284bba
to
09d836d
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_6908/ |
1 similar comment
Preview documentation changes for this PR: https://eui.elastic.co/pr_6908/ |
0f38c16
to
b75bf8f
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_6908/ |
This comment was marked as resolved.
This comment was marked as resolved.
- force focus-lock 2.9.5 for now until Anton has time to upgrade
b75bf8f
to
bd7655d
Compare
@@ -56,7 +56,8 @@ | |||
}, | |||
"resolutions": { | |||
"**/prismjs": "1.27.0", | |||
"**/react": "^17.0.0" | |||
"**/react": "^17.0.0", | |||
"react-focus-lock": "^2.9.5" |
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 resolution is necessary as latest react-focus-on
still points to 2.9.4
which doesn't yet have the react-focus-lock
fix we need (theKashey/react-focus-lock#249). Once react-focus-on
updates, we can remove this resolution
@@ -81,7 +82,7 @@ | |||
"react-beautiful-dnd": "^13.1.0", | |||
"react-dropzone": "^11.5.3", | |||
"react-element-to-jsx-string": "^14.3.4", | |||
"react-focus-on": "^3.7.0", | |||
"react-focus-on": "^3.9.1", |
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_6908/ |
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.
The changes look and work great! The cross-frame focus trap is certainly fixed now and I'm happy to merge this PR as is, but I noticed another strange behavior in react-focus-lock
(I think?) when focus trap is enabled and crossFrame=true. See the button getting focus styles when I'm clicking on the elements outside the app iframe.
Screen.Recording.2023-07-10.at.21.02.17.mov
Thanks Tomasz! That might be something to flag/file with the core |
## Summary `eui@83.1.0` ⏩ `eui@84.0.0` --- ## [`84.0.0`](https://github.com/elastic/eui/tree/v84.0.0) - Updated `EuiDualRange`'s `minInputProps` and `maxInputProps` to support passing more props to underlying inputs ([#6902](elastic/eui#6902)) - `EuiFocusTrap` now supports configuring cross-iframe focus trapping via the `crossFrame` prop ([#6908](elastic/eui#6908)) **Bug fixes** - Fixed `EuiFilterButton` icon display ([#6900](elastic/eui#6900)) - Fixed `EuiCombobox` compressed plain text display ([#6910](elastic/eui#6910)) - Fixed visual appearance of collapse buttons on collapsible `EuiResizablePanel`s ([#6926](elastic/eui#6926)) **Breaking changes** - `EuiFocusTrap` now defaults to *not* trapping focus across iframes ([#6908](elastic/eui#6908)) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Upgrades to latest
react-focus-on
which allows settingcrossFrame=false
(theKashey/react-focus-on#72).Example of previous cross frame behavior:
QA
I wasn't able to test this working behavior locally for whatever bizarre reason, so I did a pre-release RC and created a demo CodeSandbox with the RC:
General checklist
crossFrame={false}
has cross-browser Safari issues theKashey/react-focus-lock#249[ ] Props have proper autodocs (using@default
if default values are missing) and playground toggles[ ] Added or updated jest and cypress testsreact-focus-on
, not us, I'm opting to skip writing a test for this 🤷