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 gallery: wrong tab order #14814

Closed
oandregal opened this issue Apr 4, 2019 · 3 comments · Fixed by #15540
Closed

Block gallery: wrong tab order #14814

oandregal opened this issue Apr 4, 2019 · 3 comments · Fixed by #15540
Assignees
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [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

Comments

@oandregal
Copy link
Member

When you tab through images within a gallery, the tab order is:

  • image
  • caption

Note that to access the remove control at the top right you have to focus backward. The tab order should instead be:

  • remove control of the image selected
  • caption

GIF:

Peek 2019-04-04 10-14

@oandregal oandregal added [Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended labels Apr 4, 2019
@oandregal oandregal self-assigned this Apr 4, 2019
@oandregal
Copy link
Member Author

There is a proposal to fix this at #14821

@oandregal oandregal changed the title Wrong tab order within the gallery Block gallery: wrong tab order Apr 4, 2019
@oandregal
Copy link
Member Author

Copied over from #14931 as per @afercia feedback:


Noticed while testing #14822

In the gallery images, the order of the elements should be improved. Currently, the order is:

  • "Remove Image" button (see block-library-gallery-item__inline-menu)
  • the image (which is focusable)
  • the caption field

With this order, there are at least 2 issues:

  • when using a keyboard, the "Remove Image" button gets skipped because it appears after the image is focused
  • even if it wasn't skipped, the "Remove Image" button doesn't give any context on which image it will remove because it's before any relevant information related to the image

I'd propose to:

  • move the "Remove Image" button after the image: shouldn't be a big problem as it's absolutely positioned
  • make sure the button appears both when tabbing forward and when tabbing backwards

@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Apr 12, 2019
@afercia
Copy link
Contributor

afercia commented Apr 23, 2019

move the "Remove Image" button after the image: shouldn't be a big problem as it's absolutely positioned

This would probably replicate the problem when tabbing backwards. I do realize rendering elements conditionally is very react-ish but sometimes that's not great for keyboard accessibility and tab order. For a similar issue with the Button component, see #10128 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [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 a pull request may close this issue.

2 participants