react-spectrum
react-spectrum copied to clipboard
`Button`s inside a `GridListItem` are not disabled when the item is disabled
Provide a general summary of the issue here
When using the Button component inside a GridListItem, with the isDisabled prop set to true and disabledBehavior is set to "all", the button is not disabled.
๐ค Expected Behavior?
A button inside a disabled item should be disabled as well. Just like it is already done for checkboxes.
๐ฏ Current Behavior
The button can no longer be focused using the keyboard, but it is not disabled and mouse users can still press it.
๐ Possible Solution
Checkboxes are disabled using the CheckboxContext. The same should be the case for buttons.
๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
https://codesandbox.io/p/sandbox/elastic-pare-vmrszj?file=%2Fsrc%2FApp.js
https://github.com/adobe/react-spectrum/assets/31038284/5db96499-80d9-44d2-986d-00a9f22b10c4
Version
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
MacOS, Windows
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response