-
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
Impossible to make the formatting toolbar appear after Escape has been pressed #5501
Comments
Note: this happens even without going to the toolbar to apply some formatting. Just:
|
This should be somewhat improved after #5513. Specifically the notes on pressing escape in a block:
Pressing escape in the toolbar has slightly different behavior, because we're annoyingly handling escape keys in many places in many different ways. The NavigableToolbar is shifting focus to the selected block: gutenberg/editor/components/navigable-toolbar/index.js Lines 35 to 47 in 4cb41ab
Even though
So the paragraph block border shows, but the block is not technically selected. Pressing tab once more returns to the selection which existed prior to the escape press (and the block is once again selected). Maybe intended / desirable, not sure. It all seems rather convoluted and fragile though in its current form. |
I'd agree it's a bit fragile right now and maybe needs some rethinking. Pressing Escape in the toolbar should just return focus to the edited block still in a "selected" state, as I'm still editing the block. Re: #5513
Worth considering the pending experiment about "navigation mode / edit mode", see #3195 and #2031. If implemented, then pressing Escape in a block should switch back to "navigation mode." |
To reproduce, use only the keyboard:
Navigate to a block and select some text: the formatting toolbar appears
Shift + Tab to go to the toolbar and apply some formatting:
Press Escape: the toolbar correctly disappears and focus is on the block again:
Use the arrow keys to move the cursor to some other text and Shift + arrow to select some text (same if you select the previous text):
The formatting toolbar doesn't appear. The only way I've found to "fix" this is to tab away from teh block and then tab back into it.
Expected: when there's a text selection, the formatting toolbar should always appear.
Suspect: pressing Escape propagates to the block and the block is no more "selected" (notice in the screenshot above the block movers and more button are not shown).
The text was updated successfully, but these errors were encountered: