-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Improve moving focus back from the toolbars to the blocks, see focusSelection()
#5840
Comments
The last point might be tricker to achieve but yeah, these all make sense to me 👍 |
Should we consolidate with #3003 ? |
2 and 3 are still a problem on current master 3.8.0-rc.1 and need to be fixed. 1) actually depends if navigation / edit mode will be implemented, not a great progress there lately and needs to be reconsidered. |
I'm moving this from the merge milestone and into the 5.0 milestone because while I agree it'd be nice to have these improvements, I don't think they're critical. 😄 |
Summarizing the state of the 3 points above:
|
@joedolson Joe. Perhaps you could take a look at add an update to this issue? |
Testing this out today in the Accessibility Bug Scrub and looks like we have a regression. Pressing escape from the block toolbar loses focus to the top of the editor canvas iframe. I'd expect pressing escape from the block toolbar returns me to the previous focus on the block. |
Noticed while testing the "navigation/edit mode" PR #5709.
The formatting toolbar implements a keyboard-friendly feature: when focus is on the toolbar and the Escape key is pressed, focus is moved back to the selection (or insertion point) in the editable text of the block. See in
editor/components/navigable-toolbar/index.js
thefocusSelection()
function.This works pretty well for editable blocks and focus is moved back to the previous selection or caret position.
However, I'd like to propose a few improvements:
1
with the "navigation/edit mode" in #5709 , pressing Escape moves focus back to the selection and then immediately switches back to "Navigation mode" so focus is moved back to the block wrapper.
Seems to me that just stopping the event propagation would fix this.
2
In the inline toolbars (e.g. the ones for the captions):
pressing Escape from the inline toolbar does nothing. Also in this case, focus should be moved back to the selection/insertion point in the editable field. I guess
focusSelection()
should be abstracted a bit and used also for the inline toolbars.3
Not all blocks have editable fields that can get a selection. For example, consider this scenario:
In this case, I guess a possible solution would be:
focusSelection()
to allow "navigation/edit mode" to move focus back to the block wrapper/cc @youknowriad any feedback and thoughts welcome
The text was updated successfully, but these errors were encountered: