-
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
Writing Flow: avoid range removal in multi selection and select all #64658
Conversation
Size Change: +5 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
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.
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.
removalAllRanges
was added in #42711 and I didn’t see mention of what necessitated it. I suppose all of the List block features could use testing? I haven’t found any issues so far.
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. |
Closing this because #63671 incidentally fixed the issue. |
What?
A naive attempt to fix #64617
Why?
To resolve an issue where a selected container block can become unselected as the window regains focus. This probably hardly ever bothers a human but I have another PR that mysteriously surfaces the issue in E2E tests and that’s what made me aware of it and is the actual motive.
How?
Avoids removing the selection and instead collapses it to the active node.
It seems the reason this works is it avoids a
selectionchange
event being fired when the window regains focus and thereby avoids theuseSelectionObserver
hook moving focus here:gutenberg/packages/block-editor/src/components/writing-flow/use-selection-observer.js
Lines 125 to 144 in b1324c5
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast