Open jeryj opened 4 years ago
I see how useToolbarFocus creates a shortcut for Alt-F10 to focus the relevant toolbar. I don't see how/when this comes into play when using regular Tab and Shift+Tab keys. Where is that if it exists?
This isn't really a viable solution since it changes the design, but I at least wanted to document something I found in this difficult ticket.
Wrapping <UpgradePlanBanner>
in <BlockControls>
and tweaking the CSS puts the banner inside the toolbar, which is already keyboard accessible. Then you can tab to the upgrade button:
Not saying this is a solution, but maybe this is a springboard for ideas. I think possibly changing the dom positioning of the <UpgradePlanBanner>
is one approach.
https://github.com/Automattic/jetpack/pull/16611 introduced the Premium Upgrade banner and icons to different parts of the editor.
Currently, there is no way to reach the upgrade button only using the keyboard. The focus skips from the toolbar directly into the block.
This banner sits visually between the block controls and the block itself, so the ideal flow would be:
TAB
- block toolbarTAB
- upgrade buttonTAB
- whatever would have been focused in the blockThe block toolbar and the block itself are not adjacent in the DOM, but focus is managed by programmatically sending focus from the toolbar to the block. I don't know if it's possible, but we'd need to somehow intercept/modify that sending of focus while still making sure we don't break the default functionality when it's not present. It may be a tricky one.
The Upgrade banner itself is skipped when using a screen reader to read through the screen for you, so there's no way to know that it's there.
Steps to reproduce the issue