Provide a general summary of the issue here
When a ComboBox is configured with both selectionMode="multiple" and allowsCustomValue,
all previously selected keys are cleared if the user types something in the input and then
presses Escape, Enter, or Tab.
🤔 Expected Behavior?
Pressing Escape, Enter, or Tab should close/commit the input without affecting previously
selected items. The selected keys should remain unchanged unless the user explicitly
deselects an item.
😯 Current Behavior
After typing in the input:
- Pressing Escape clears all selected keys (resets selection to empty)
- Pressing Enter clears all selected keys
- Pressing Tab clears all selected keys
This does not occur when allowsCustomValue is omitted — the bug is specific to the
combination of selectionMode="multiple" + allowsCustomValue.
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
- Render a
ComboBox with selectionMode="multiple" and allowsCustomValue
- Select two or more items (e.g. Norway and Sweden)
- Click the input and type any partial string (e.g. "den")
- Press Escape (or Enter, or Tab)
Expected: selected keys remain [no, se]
Actual: selected keys are cleared (empty selection)
Minimal reproduction:
import { Button, ComboBox, ComboBoxValue, Input, Label, ListBox, ListBoxItem, Popover } from 'react-aria-components';
const countries = [
{ id: 'no', label: 'Norway' },
{ id: 'se', label: 'Sweden' },
{ id: 'dk', label: 'Denmark' },
];
function Example() {
return (
<ComboBox
selectionMode="multiple"
defaultValue={['no', 'se']}
allowsCustomValue
>
<Label>Country</Label>
<div style={{ display: 'flex' }}>
<Input />
<Button>▼</Button>
</div>
<ComboBoxValue>
{({ selectedItems, isPlaceholder }) =>
isPlaceholder
? 'None selected'
: `Selected: ${selectedItems.map(item => item?.id).join(', ')}`
}
</ComboBoxValue>
<Popover>
<ListBox items={countries}>
{item => <ListBoxItem id={item.id}>{item.label}</ListBoxItem>}
</ListBox>
</Popover>
</ComboBox>
);
}
Version
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
Provide a general summary of the issue here
When a
ComboBoxis configured with bothselectionMode="multiple"andallowsCustomValue,all previously selected keys are cleared if the user types something in the input and then
presses Escape, Enter, or Tab.
🤔 Expected Behavior?
Pressing Escape, Enter, or Tab should close/commit the input without affecting previously
selected items. The selected keys should remain unchanged unless the user explicitly
deselects an item.
😯 Current Behavior
After typing in the input:
This does not occur when
allowsCustomValueis omitted — the bug is specific to thecombination of
selectionMode="multiple"+allowsCustomValue.💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
ComboBoxwithselectionMode="multiple"andallowsCustomValueExpected: selected keys remain [no, se]
Actual: selected keys are cleared (empty selection)
Minimal reproduction:
Version
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