adobe / adobe/react-spectrum

RAC: MultipleSelection for selectionMode=single

Open
#9,849 3 comments 0 reactions 0 assignees View on GitHub
typescript
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the issue here

Several components (eg, Table, Menu) extend MultipleSelection, that is not narrowed when selectionMode=single.

### 🤔 Expected Behavior?

These components should behave like Select or ComboBox where it is supported the generic SelectionMode.

https://github.com/adobe/react-spectrum/blob/383602e61a597fb132f5b037a42bd286d93c6103/packages/react-aria-components/src/Select.tsx#L88

### 😯 Current Behavior

Even on selectionMode=single the onSelectionChange has `'all' | Iterable`.

### 💁 Possible Solution

_No response_

### 🔦 Context

RAC 1.16.0

### 🖥️ Steps to Reproduce

https://stackblitz.com/edit/y338udnj?file=src%2FExample.tsx

### Version

RAC 1.16.0

### What browsers are you seeing the problem on?

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

MacOS

### 🧢 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.