adobe/react-spectrum

Selectable Collection keyboardDelegates

Open

#6,839 创建于 2024年8月7日

在 GitHub 查看
 (0 评论) (1 反应) (0 负责人)TypeScript (1,500 fork)auto 404
help wanted

仓库指标

Star
 (15,634 star)
PR 合并指标
 (PR 指标待抓取)

描述

Provide a general summary of the feature here

From https://github.com/adobe/react-spectrum/pull/5812

Add/modify the keyboard delegates so that they can accept a similar kind of keyboard handler override that was done in the linked PRs useSelectableCollection and then refactoring useSelectableCollection so it would call that delegate keyboard handler and pass whatever key it received from it to navigateKey.

It'd involve creating a base class for the KeyboardDelegates along with some abstract functions for extending classes to implement.

There will need to be some experimentation done there since it might cause some issues in Virtualizer/other places that have also use keyboardDelegate, but this approach would ideally allow users to create their own keyboard delegates to override the keyboard actions and/or extend from the base level keyboard delegates if they only wanted to add/override a single action.

🤔 Expected Behavior?

Users can provide their own KeyboardDelegates with granular control over key handling

😯 Current Behavior

This isn't possible right now

💁 Possible Solution

No response

🔦 Context

Initial exploratory work done here https://github.com/adobe/react-spectrum/pull/5812

💻 Examples

No response

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

贡献者指南