[EuiFocusTrap] Default to not trapping focus across iframes#6908
[EuiFocusTrap] Default to not trapping focus across iframes#6908cee-chen merged 5 commits intoelastic:mainfrom
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
| "**/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.
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
| "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", |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6908/ |
tkajtoch
left a comment
There was a problem hiding this comment.
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-onwhich 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@defaultif 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 🤷