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

Parent block selector button: missing focus style when 'Show button text labels' is enabled #57710

Closed
afercia opened this issue Jan 10, 2024 · 2 comments · Fixed by #57728
Closed
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@afercia
Copy link
Contributor

afercia commented Jan 10, 2024

Description

The Parent block selector button doesn't show a focus style when 'Show button text labels' is enabled.

Focus indication must always be clear. It appears it broke after #56335

Turns out all the buttons must use position: relative to allow the CSS pseudo generated element responsible for the focus style to appear and be positioned correctly. #56335 set position: static on this button, thus breaking the focus style.

Screenshot from WordPress 6.4:

6 4

Screenshot from Gutenberg trunk:

trunk

Note: the button label is now longer, it changed in #56146

When the 'Top toolbar' is enabled, the focus style is visible. Screenshot:

Screenshot 2024-01-10 at 09 57 22

Other visual glitches

Left and right padding is inconsistent compared with other buttons. Screenshot:

Screenshot 2024-01-10 at 10 00 55

When 'Top toolbar' is enabled, a 'dot divider' visually separates the parent selector button from the other buttons. The dot is unevenly positioned, with both icons or text displayed. Screenshots:

Screenshot 2024-01-10 at 09 18 12

Screenshot 2024-01-10 at 09 32 44

Step-by-step reproduction instructions

  • Enable: Options > Preferences > Accessibility > 'Show button text labels'
  • Add a Group block and add a few paragraphs within it.
  • Select one of the paragraphs.
  • Shift+Tab to move focus to the block toolbar.
  • Observe the parent selector button doesn't show any focus style.
  • Visual glitches: see screenshots.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Regression Related to a regression in the latest release [Package] Block editor /packages/block-editor labels Jan 10, 2024
@afercia afercia self-assigned this Jan 10, 2024
@afercia
Copy link
Contributor Author

afercia commented Jan 10, 2024

Also: the font size of the 'block switcher' button (the text 'Paragraph' in the screenshot below) is clearly bigger than the font size of the other buttons. It's 14 pixels vs. 12 pixels. This inconsistency doesn't help with aligning the buttons text. Seems simple enough to fix in this issue.

Screenshot 2024-01-10 at 14 55 40

The font size inconsistency is visible also in the Site Editor:

Screenshot 2024-01-10 at 15 59 26

Introduced in #28691 for the template part 'display title'. I'm not sure that is still in use and anyways it shouldn't be done this way.

@afercia
Copy link
Contributor Author

afercia commented Jan 10, 2024

Just noticed one more problem: wiht 'Top toolbar' and 'Show icon labels' enabled, the block toolbar buttons shift vertically by 1 pixel when moving focus between the buttons 'Move Up' and 'Moce Down'. See animated Gif below.

This is triggered ny some overflow CSS properties applied to the toolbar:

    overflow: auto;
    overflow-y: hidden;

There's two problems with this:

  • The vertical shift should not happen.
  • More importantly: with Firefox there is a silent tab stop between the document tools toolbar and the block toolbar. Firefox makes focusable all scrollable elements that have an actual content overflow. As such, the div element with overflow is focusable in Firefox. This is far from ideal for keyboard accessibility and needs to be fixed. Will create a separate issue.

Animated GIF to illustrate the vertical shift on current trunk:

shift

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). [Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant