Writing Flow: avoid range removal in multi selection and select all#64658
Writing Flow: avoid range removal in multi selection and select all#64658stokesman wants to merge 1 commit into
Conversation
|
Size Change: +5 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
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
selectionchangeevent being fired when the window regains focus and thereby avoids theuseSelectionObserverhook 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