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
Navigation mode: polish enabling when no block is selected #19298
Conversation
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 I remember properly, this behavior is related to the "PostTitle" component where sometimes we tab through it and sometimes we don't right?
What if instead of trying to hack around "auto-enabling" the navigation mode, we make sure the "PostTitle" behaves like a block. I guess thisi means when we tab out from it in edit mode, instead of going to the next block, we just skip all the blocks?
@youknowriad It's related, but it should work from both sides. When I tab from the header to the block list, and no blocks are selected, navigation mode should be enabled. When I tab backwards from the document sidebar, and no blocks are selected, navigation mode should also be enabled. I do agree that the post title should behave as much as possible like a block, or be a block, since it's wrapped in |
I guess what I don't understand is why we auto-enable Navigation mode. I think explicitness is better in most cases. |
@youknowriad Yes, it would be better if navigation mode were enabled by default. This would make most sense because you |
We had it by default and it broke other stuff (first focus in the post title) and also a lot of confusion from users so we reverted. |
Exactly, so we can't enable it by default, and this seems like the right solution. May I ask why it is ok to auto-enable Edit mode when using the mouse, but not ok to auto-enable Navigation mode when using the keyboard? |
Good question :) I guess I'm biased here but the thinking for me at least is that "double click" explicitly means "edit" whlie "tabbing" not necessarily "navigation mode" (since you can also tab in "edit" mode) |
That's a good point though. |
So the double-click is a bit like tabbing into the block list without any block selected. :) |
Ok you convinced me :P |
@youknowriad Thanks for the discussing and review. I'll add an e2e test for this behaviour before merging. |
Description
Polishes #19238: don't enable navigation mode on tab, but rather use the
FocusCapture
elements to detect incoming keyboard navigation. This fixes an issue where navigation mode is enabled after tabbing outside the block list (e.g. document sidebar) and then clicking on a block.To do: add e2e tests.
How has this been tested?
Screenshots
Types of changes
Checklist: