adobe / adobe/react-spectrum

Selectable Collection keyboardDelegates

Open
#6,839 0 comments 1 reaction 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.