-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: fix Shift+Click multi select #53440
Conversation
Size Change: +25 B (0%) Total Size: 1.5 MB
ℹ️ View Unchanged
|
@@ -198,6 +198,7 @@ export function useClipboardHandler() { | |||
if ( shouldHandleWholeBlocks && ! expandSelectionIsNeeded ) { | |||
removeBlocks( selectedBlockClientIds ); | |||
} else { | |||
event.target.ownerDocument.activeElement.contentEditable = false; |
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 is actually a bug introduced in #40098. When using __unstableDeleteSelection
, contenteditable needs to be turned off first (see other instances). Ideally we should move this logic to writing flow and build in clipboard handling there.
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.
Works!
Before (unable to multi-select):
CleanShot.2023-08-09.at.21.58.11.mp4
After (able to multi-select):
CleanShot.2023-08-09.at.21.59.19.mp4
798134a
to
2115ab4
Compare
Added the existing e2e test to be run on WebKit. |
What?
Fixes #44755.
Safari doesn't allow Shift+Click selection inside content editable into an element with a tab index. Instead it focusses that element. Except for removing the tab index, there's no way to otherwise prevent a focusable element from gaining focus as far as I know. Normally, contentEditable should be disabling all interactivity.
Why?
How?
Thought a while about it, and then realised we don't actually need the tab index is the element is content editable, because these elements are already focusable.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast