adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
13.09k stars 1.14k forks source link

ActionGroup: When overflowMode collapse is used, resulting menubutton with ellipsis needs a better label #4129

Open dineshy87 opened 1 year ago

dineshy87 commented 1 year ago

๐Ÿ› Bug Report

When OverflowMode: collapse results in Actiongroups behaving like menu buttons, the resulting menubutton seems to have an aria-label=โ€œโ€ฆโ€. This is announced as "ellipsis" when voiceOver is used. And on windows, NVDA and narrator consider it as having no label and announces nothing. Refer to this storybook example

Note: This effects ActionBar as well and is more of an issue on mobile because actiongroup is almost always collapsed on mobile.

๐Ÿค” Expected Behavior

Instead of aria-label="...", more may be a better label for these menubuttons or something else. In cases where entire toolbar can be collapsed to one button, the menubutton must take that the label of toolbar itself. (I see that it's already happening in this example)

๐Ÿ˜ฏ Current Behavior

Collapsed menubutton has aria-label="..." which is completely ignored by some screen readers. And therefore is not an ideal label for the button.

๐Ÿ’ป Code Sample

Issue can be observed on these storybook examples by testing using NVDA on Firefox/Edge.

You can use https://assistivlabs.com/ to verify this if you do not have a windows machine.

๐ŸŒ Your Environment

Software Version(s)
react-spectrum 3
Browser Firefox & Edge (at least)
Operating System Windows

๐Ÿงข Your Company/Team

๐Ÿ•ท Tracking Issue (optional)

snowystinger commented 3 months ago

Storybook is not our documentation. It's just for internal testing. Our docs page appears to have a better label https://react-spectrum.adobe.com/react-spectrum/ActionMenu.html#actionmenu Closing, if there are any in the docs pages which need better labels, we can reopen.

snowystinger commented 3 months ago

Ah, I see. The ellipsis does appear in the docs if you get the ActionGroup to partially collapse. The aria-label is only passed through to the ActionButton for the menu if every item is hidden. We should probably have a better/localized string instead of the 'โ€ฆ' https://github.com/adobe/react-spectrum/blob/cfd890edf73783cbea0b94316d69f4bdced5ed8a/packages/%40react-spectrum/actiongroup/src/ActionGroup.tsx#L390