WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Using Aria within a table to indicate that a cell is highlighted

for

From: glen walker
Date: Jul 4, 2022 6:24PM


If you want to provide a way to jump to highlighted cells (assuming you can
have more than one highlighted - or maybe this is a conditional
highlighting example where cells of a certain value have a different visual
appearance than other cells), then you're probably better off programming
the shortcut key yourself so that it's available to all users.

Using headings or aria-current is sort of a hack. Yes, headings allow
screen reader users to jump to a place on the page but you're only using a
heading to get that feature from the screen reader and the cell isn't
really a "heading" for anything, thus why Kevin said it might break 1.3.1,
although in kind of the reverse way. Usually 1.3.1 is for having a visual
relationship on the page but there isn't a programmatic relationship. The
highlighted cell heading is the opposite - you are creating a programmatic
relationship when there isn't really a visual relationship. Yes, there's a
visual difference for the highlighted cells but that doesn't make the cell
a heading.

We did something like this for navigating to landmarks. Screen reader
users can easily navigate to landmarks but sighted keyboard users cannot.
It's not built-in to the browser. So we programmed Ctrl+F6 to allow
navigating to landmarks. All users could access it. (F6 is a common key
for navigating to different parts of an application so we used Ctrl+F6 in a
similar vein.)

F2 is a common key for spreadsheets to edit the cell value. You could
conceptually create a Ctrl+F2 to navigate to the next highlighted cell.
The two behaviors (F2 and Ctrl+F2) aren't really related so that might be a
poor key choice, but it's just an example.

You'd have to be clear in your documentation that that shortcut key exists.