react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

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

Open gregberge opened this issue 1 year ago โ€ข 3 comments

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

gregberge avatar Jun 01 '24 14:06 gregberge

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

reidbarber avatar Jun 03 '24 17:06 reidbarber

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?

snowystinger avatar Jun 06 '24 08:06 snowystinger

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

reidbarber avatar Jun 06 '24 19:06 reidbarber