-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Enabled toolbar focusing and cycling across all editors and features #12064
Conversation
…ethods to EditorUI. Implemented tracking focus across multiple toolbars.
… in EditorUI to enable the Alt+F10 focus support.
…e toolbar back to the right place.
…ethods of `EditorUI`.
…setEditableElement.
…is controlled exclusively by EditorUI.
Use-case to fix: when pressing Alt+F10 in a toolbar when there's no other toolbar to focus:
|
Use-case to fix (low priority): when pressing Alt+F10 in a toolbar when some dropdown is open and the focus moves to another toolbar, the dropdown should close. |
…f there is no other focusable toolbar available.
Co-authored-by: Kuba Niegowski <[email protected]>
Use-case to fix: when pressing ALT+F10 more than once in Balloon Editor when only one toolbar is available to focus:
balloon.editor.focus.lost.2022-08-16.at.14.17.19.mov |
Another use-case to fix: pressing ALT+F10 on an image sitting in a table:
Videos:
balloon.block.editor.2022-08-16.at.15.14.15.mov
classic.editor.2022-08-16.at.15.33.10.mov |
…gistering a toolbar to allow EditorUI do a clean up when switching between toolbars.
but it will fail when the table cell content was focused first before an image: @Acrophost Could test the toolbars again to verify if my recent fixes do not introduce new regressions? Thanks. |
@oleq everything works much better and I don't see any more issues besides the one you have already mentioned :) |
Suggested merge commit message (convention)
Feature (core): Enabled toolbar focusing (and cycling) across all editor implementations and features. Closes #10368. Closes #5146. Closes #9906. Closes #10025.
BREAKING CHANGE (ui): The
enableToolbarKeyboardFocus()
helper has been removed. Please use theEditorUI#addToolbar()
method instead to enable accessible toolbar navigation (and focusing) usingAlt+F10
andEsc
keystrokes (see #10368).Additional information
TODOs
EditorUI
WidgetToolbarRepository
to make sure it registers things inEditorUI
BalloonToolbar
.EditorUI#focusNextFocusableToolbarDefinition
(see the code to learn more)EditorUI#_initFocusTracking
should probably become private methods ofEditorUI
.EditorUI#registerFocusableEditingArea()
has an obsolete support of UI views that we probably don't need at this stage.EditorUI
EditorUI
API.enableToolbarKeyboardFocus()
and new API).enableToolbarKeyboardFocus()
pointing to the newEditorUI
API.Follow-ups
WidgetToolbarRepository
should have these labels (image, table, etc.).FocusCycler
to move around the UI (cycling the toolbars) but I didn't do this in this PR. I supposeFocusCycler#_getFocusableItem()
is too simple to make decisions I implemented in this PR (toolbars have priorities and deciding which to focus is a lot harder). But I suppose we could unify everything down the road.FocusCycler
navigating 2-dimensional focus planes (toolbars are focus vectors, grids are focus matrices). Maybe this is the right time to giveFocusCycler
a boost and some Swiss knife vibes and handle all of this?SourceEditing
that I first decided to handle here but then I figured things were already getting complex so I extracted the code to a separate PR. Long story short, this is aboutSourceEditing
using ckeditor5-ui to bring its UI (textarea) and reduce internal redundancy.