Skip to content
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

Block editor: fix misplaced rich text inline toolbar #29874

Closed
wants to merge 1 commit into from

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Mar 15, 2021

Description

Fixes #26114.
Alternative to #28420.

Currently the inline toolbar popover is misplaced and positioned before the block toolbar, which means that you have to tab through the block toolbar to access it. The inline toolbar popover should be positioned after the block toolbar popover so it receives focus before the block toolbar when reverse tabbing from the block.

Both popovers are filled into the same slot and unfortunately it's not possible to set the order from a fill. I added another slot to enforce the order. Ideally, we should have a better API to define the toolbar area for a block editor.

In the GIF below I use Shift+Tab to navigate to the block toolbar and through the buttons to "Bold".

inline-toolbar

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@ellatrix ellatrix added the [Type] Bug An existing feature does not function as intended label Mar 15, 2021
@ZebulanStanphill ZebulanStanphill added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [a11y] Keyboard & Focus labels Mar 15, 2021
@ellatrix ellatrix changed the title Block editor: add inline toolbar slot Block editor: fix misplaced rich text inline toolbar Mar 15, 2021
@talldan
Copy link
Contributor

talldan commented Mar 17, 2021

Testing this, I'm seeing the block wrapper focused first when shift tabbing from an image caption.

@ellatrix
Copy link
Member Author

Right, that seems like a bug in our writing flow. I'll look into it.

@diegohaz
Copy link
Member

I think we use a FocusCapture component to focus on the block toolbar when pressing Shift+Tab from the block wrapper. We would have to do something similar for the inline toolbar too.

@ellatrix ellatrix mentioned this pull request Mar 18, 2021
7 tasks
@ellatrix
Copy link
Member Author

Will be fixed as part of #31134 so closing this.

@ellatrix ellatrix closed this Apr 27, 2021
@ellatrix ellatrix deleted the try/inline-toolbar-slot branch April 27, 2021 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyboard navigation to image caption toolbar
4 participants