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
12.75k stars 1.09k forks source link

Support "aria-keyshortcuts" in react-aria-components #6478

Open gregberge opened 4 months ago

gregberge commented 4 months ago

Provide a general summary of the feature here

I want to be able to set aria-keyshortcuts on a Button.

๐Ÿค” Expected Behavior?

<Button aria-keyshortcuts="S" />

It should add the property on the element.

๐Ÿ˜ฏ Current Behavior

It does not work.

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-keyshortcuts

๐Ÿ’ป Examples

No response

๐Ÿงข Your Company/Team

Argos

๐Ÿ•ท Tracking Issue

No response

reidbarber commented 4 months ago

I think we could add this to AriaBaseButtonProps here: https://github.com/adobe/react-spectrum/blob/cef3714bb8816a4ee64ffb1d0730f2669738d2e4/packages/%40react-types/button/src/index.d.ts#L49-L63

snowystinger commented 3 months ago

Just to make sure I understand, just putting the attribute on one of our elements won't do anything other than read off to AT?

It doesn't actually do anything right? If so, then I think this is fine. Though it sounds like it's supported on every HTML element? it's going to be harder to decide which components it makes sense on. What all do you want it on so far? Just button?

reidbarber commented 3 months ago

@snowystinger Yeah, I think just Button is a good start, and maybe Link as well.