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

Section does not apply aria label

Open Shadowlauch opened this issue 1 year ago โ€ข 1 comments

Provide a general summary of the issue here

I was following the steps laid out in https://react-spectrum.adobe.com/react-aria/Menu.html#section and added an aria-label to the section, but this label is not actually applied to the dom.

๐Ÿค” Expected Behavior?

I would expect the aria-label that was handed into the Section to be applied to the dom

๐Ÿ˜ฏ Current Behavior

The aria-label that was handed into the Section is not applied to the dom

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

https://codesandbox.io/p/sandbox/magical-sun-fty327

Version

3.31.0

What browsers are you seeing the problem on?

Firefox, Chrome

If other, please specify.

No response

What operating system are you using?

Mac

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

Shadowlauch avatar May 21 '24 03:05 Shadowlauch

Thanks for reporting this, it looks like this line has a typo https://github.com/adobe/react-spectrum/blob/b77d7d594dff4dcfb5359bffbcfd18142b146433/packages/react-aria-components/src/Menu.tsx#L232

'aria-label': section['aria-label'] ?? undefined
// should be
'aria-label': section.props['aria-label'] ?? undefined

snowystinger avatar May 21 '24 03:05 snowystinger