Repository navigation
Writing Flow: Consider tabbable edge if no adjacent tabbable - #6542
Conversation
|
Hi @aduth these changes fix the errors, but I noticed a behavior change when comparing against the master. |
|
Heh, I think this is one of those odd circumstances where the presence of the error was actually providing a desirable behavior. As implemented, this is expected: When pressing Shift+Down, we prevent the browser default behavior, and only expand the selection if an adjacent block exists: gutenberg/editor/components/writing-flow/index.js Lines 202 to 203 in 480990a gutenberg/editor/components/writing-flow/index.js Lines 140 to 147 in 480990a Because no next block exists, it's expected that (a) the browser default is prevented and (b) nothing else happens. We could revise this so that the browser default is only prevented if the selection can be expanded. That said, it's a bit inconsistent to set expectations for users that Shift+Down can trigger the "select to end of block" behavior for the last block, but no other blocks (where multi-select takes effect instead). What do you think? In the meantime, since this is "Working as Intended" so far as the current implementation is concerned, I'm inclined to merge as is. |
|
Also noting that #6467 introduces a new "Writing Flow" end-to-end test suite, which would be a good place to assert whatever behavior we decide upon as being intended. |
|
Nice to see the e2e writing flow test setup. |

This pull request seeks to resolve an error which occurs when making a forward shift selection in the last paragraph of a post, or a backward shift selection in the title.
Implementation notes:
closestTabbablemay beundefinedif there are no more tabbable fields in the desired direction. Since the intent ofisTabbableEdgeis to discern between there being other tabbables in the same block, it is reasonable to expect this should returntrueif there are no more tabbables. Where used, this may lead toexpandSelection, but this already accounts for the case where there is no adjacent block.Testing instructions:
Verify backward shift-selection from title results in no errors.
Verify forward shift-selection from last paragraph of content results in no errors.