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

`Button`s inside a `GridListItem` are not disabled when the item is disabled

Open joshuajaco opened this issue 1 year ago โ€ข 0 comments

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

[email protected]

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

joshuajaco avatar May 03 '24 15:05 joshuajaco