Repository navigation
Description
Provide a general summary of the issue here
In a Select with selectionMode="multiple", "select all" does nothing. Both state.selectionManager.selectAll() (via SelectStateContext) and Cmd/Ctrl+A in the open list leave the selection unchanged, and onChange is never called. Selecting items one at a time works, and the same actions work on a standalone ListBox.
🤔 Expected Behavior?
Every enabled item is selected, and onChange is called with all keys. This is what happens in a standalone ListBox with selectionMode="multiple".
😯 Current Behavior
Nothing is selected, onChange is not called, and nothing is logged.
StackBlitz Reproduction
https://stackblitz.com/github/deebov/rac-select-multiple-select-all?file=src%2FApp.tsx
🖥️ Steps to Reproduce
- Open the "Fruits"
Selectin section 1 of the repro. - With the list focused, press Cmd/Ctrl+A, or click the
selectionManager.selectAll()button inside the popover.valuestays[]andonChange callsstays0. - Click "Apple".
valuebecomes["Apple"]andonChange callsbecomes1, so the state itself is wired correctly. - For comparison, focus the standalone
ListBoxin section 2 and press Cmd/Ctrl+A. The selection becomes"all".
function SelectAllButton() {
let state = useContext(SelectStateContext);
return <Button onPress={() => state?.selectionManager.selectAll()}>Select all</Button>;
}
<Select selectionMode="multiple" value={value} onChange={setValue}>
<Label>Fruits</Label>
<Button><SelectValue /></Button>
<Popover>
<ListBox>
<ListBoxItem id="apple">Apple</ListBoxItem>
<ListBoxItem id="banana">Banana</ListBoxItem>
</ListBox>
<SelectAllButton />
</Popover>
</Select>💁 Possible Solution
SelectionManager.selectAll() sets the selection to 'all', and useSelectState drops that value in the list state's onSelectionChange:
onSelectionChange: (keys: Selection) => {
// impossible, but TS doesn't know that
if (keys === 'all') {
return;
}
...
}The guard was added in #8734, when Select moved from useSingleSelectListState to useListState to support multiple selection. In single selection 'all' really is impossible, but in multiple selection both selectAll() and Cmd/Ctrl+A produce it.
Turning 'all' into the enabled item keys fixes both cases in the repro (tested by patching node_modules):
if (keys === 'all') {
keys = new Set(
[...listState.collection.getKeys()].filter(
key => listState.collection.getItem(key)?.type === 'item' && !listState.selectionManager.isDisabled(key)
)
);
}This may be related to #10147. In both cases the problem comes from useSelectState storing the selection as a plain Key[], which loses information that Selection carries: the anchor key there, and 'all' here. If that is being reworked, it would be good to cover 'all' as well.
🔦 Context
We build a multi-select dropdown on Select with selectionMode="multiple", with a "Select all" action in the popover footer. Right now we work around this by calling state.setValue() with the item keys ourselves, but users who reach for selectionManager.selectAll() get a silent no-op, and the keyboard shortcut stays broken.
Version
react-aria-components 1.22.1, react-stately 3.51.0, react 19.3.1
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS 15
🧢 Your Company/Team
Untitled UI
Activity
snowystinger commentedon Nov 12, 2026
Out of curiosity, why not make an additional item "All"
deebov commentedon Nov 13, 2026
@snowystinger Then I guess the consumer would have to subtract the items when one of the items is being de-selected in "all" mode? I think sometimes you want to select all except a few.