adobe/react-spectrum

Disable entire ListBox without needing to set disabledKeys

开放

#5,837 创建于 2024年2月8日

 (3 条评论) (0 个反应) (0 位负责人)TypeScript (1,500 个派生)auto 404
ListBoxaccessibilityenhancementhelp wanted

仓库指标

星标
 (15,634 个星标)
PR 合并指标
 (平均合并 8天 2小时) (30 天内合并 80 个 PR)

描述

Provide a general summary of the feature here

Hey folks,

I have a ListBox which is displayed inline (aka not popped out by a trigger) inside a component which can be disabled. I'd like to be able to disable a ListBox component entirely without needing to know ahead of time what the items are within the ListBox. Adding aria-disabled would make sense I think too.

🤔 Expected Behavior?

<ListBox items={...} isDisabled> should disable interaction with all items in the ListBox, and possibly set aria-disabled on the ListBox outermost element.

😯 Current Behavior

Currently it's not possible to disable a ListBox, you have to provide a disabledKeys prop with the id of all the items. This is problematic if you don't know what the items are ahead of time, or just error prone if the list is manually created.

💁 Possible Solution

No response

🔦 Context

I have an area of my page which is enabled or disabled based on state, the ListBox is inside an area which should be disabled.

💻 Examples

No response

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

贡献者指南