-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Safari: prevent focus capturing caused by flex display #66402
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
packages/rich-text/src/component/event-listeners/prevent-focus-capture.js
Outdated
Show resolved
Hide resolved
packages/rich-text/src/component/event-listeners/prevent-focus-capture.js
Outdated
Show resolved
Hide resolved
packages/rich-text/src/component/event-listeners/prevent-focus-capture.js
Outdated
Show resolved
Hide resolved
packages/rich-text/src/component/event-listeners/prevent-focus-capture.js
Outdated
Show resolved
Hide resolved
Size Change: -162 B (-0.01%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
|
||
await expect | ||
.poll( multiBlockSelectionUtils.getSelectedFlatIndices ) | ||
.toEqual( [ 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.
So this is a weird failure: we're actually also expecting this test to clear selection in trunk (it even says it in the test title), but for some reason after the first click we check if one block is selected, and on check if selection is cleared after the second click. This caused the webkit test to fail, it now always clears the selection. When I tested Chrome manually, it did the same, but for some reason with Playwright it's still relying on two clicks.
I've also included Firefox now which seems to pass after these changes.
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.
I think we introduced some weird CSS styles to fix this issue initially on Chrome, should we remove the CSS styles?
9fd89e3
to
e8e864a
Compare
@youknowriad Yes, removed it. Seems to work well in Chrome too. |
It's a good general block across all block and all browsers. |
@youknowriad Yeah, that's why I added |
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: mcsf <mcsf@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
What?
Following up from #65857. The browser bug demonstrated: https://codepen.io/iseulde/pen/OJKNWOz
Why?
How?
We can disable content editable when clicking a parent element to prevent it from capturing focus.
Testing Instructions
Click on the group padding in Safari (try many times). It should not move focus to rich text.
Testing Instructions for Keyboard
Screenshots or screencast