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

Table Accessibility when table has horizontal scrolling - Ensure that scrollable region has keyboard access #38380

Open
LukaszJaro opened this issue Jan 31, 2022 · 1 comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@LukaszJaro
Copy link

LukaszJaro commented Jan 31, 2022

Description

When inserting tables using the blocker editor, many of them will end up with horizontal scrolling, depending on width and amount of columns, which is fine and expected in the many themes I use.

The accessibility issue I am being flagged on is when there is no keyboard focus on the table which has horizontal scrolling, more info here https://dequeuniversity.com/rules/axe/4.3/scrollable-region-focusable and here https://www.w3.org/WAI/standards-guidelines/act/rules/scrollable-element-keyboard-accessible-0ssw9k/

I'm specifically referring to front-end of the site but it may be an issue on editor side as well. This is not specific to tables but tables happen to more commonly receive horizontal focus. Vertical scrolling would be an issue as well.

Bugs have been filed in chrome https://bugs.chromium.org/p/chromium/issues/detail?id=585413, but some arguments on if browser should really handle this like firefox does.

Craft CMS also dealt with this craftcms/cms#7236

May have some relation to #8401

Potential solution: https://marcus.io/blog/accessible-overflow

Step-by-step reproduction instructions

  1. Insert block table
  2. Add columns with content until horizontal scrolling appears. Table can be put in small column to enhance effect.
  3. Publish and view on front-end
  4. Tab with keyboard on chrome or edge and watch as table with horizontal scrolling is skipped

Alternative, follow above but on Firefox to see descried behavior.

Screenshots, screen recording, code snippet

Keyboard user can't focus on this table and scroll:

image

Environment info

  • Any theme is impacted unless they are using custom solution like adding tabindex or focusable element inside the table.
  • Impacts chrome and edge, firefox actually handles this and allows keyboard focus scrolling.
  • I currently can't test on Safari.

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

@joedolson joedolson added [a11y] Keyboard & Focus [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Feb 2, 2022
@LukaszJaro
Copy link
Author

LukaszJaro commented Feb 4, 2022

Of course, we don't want to make the table container focusable unless its contents overflow. Otherwise we're adding a tab stop to the focus order which doesn't do anything. In my opinion, that would be a fail under 2.4.3 Focus Order. Giving keyboard users elements to focus which don't actually do anything is confusing and obstructive.

https://inclusive-components.design/data-tables/#goingresponsive
https://inclusive-components.design/data-tables/#onlyfocusablewherescrollable

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).
Projects
None yet
Development

No branches or pull requests

3 participants