ComboBox with selectionMode="multiple": Cmd/Ctrl+A does nothing while the popover is open

Aperta Adatta ai principianti
#10,866 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mangeshraut712 ci sta già lavorando.

Dal 27/10/2026.

  • #10868 di @mangeshraut712 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

Inizia da useComboBox, dove, secondo l’issue, useSelectableCollection gestisce l’evento keydown del campo di input quando il popover è aperto, e controlla i test ComboBox esistenti relativi al comportamento della tastiera. Verifica che Cmd/Ctrl+A selezioni il testo del campo di input in modalità di selezione multipla con il popover aperto, preservando il comportamento documentato della modalità singola; aggiungi o aggiorna un test mirato per il risultato atteso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Provide a general summary of the issue here

In a multi-select ComboBox, pressing Cmd+A / Ctrl+A doesn't select the text in the input while the popover is open. It doesn't select any options either, so the shortcut just does nothing.

🤔 Expected Behavior?

Cmd/Ctrl+A selects the text in the input, same as with selectionMode="single" or when the popover is closed.

😯 Current Behavior

Nothing happens. The keydown is default-prevented, so the browser doesn't select the text, and the selection doesn't change. As far as I can tell:

  • useComboBox applies the onKeyDown from useSelectableCollection to the input while the popover is open. It doesn't pass disallowSelectAll.
  • In multiple selection mode, useSelectableCollection handles Mod+A by calling manager.selectAll(). The handler returns undefined, so the event gets preventDefault().
  • selectAll() calls onSelectionChange('all'), and useComboBoxState ignores that (if (keys === 'all') return;).
💁 Possible Solution

Pass disallowSelectAll: true to useSelectableCollection in useComboBox. Select-all-options from a text field seems unexpected to me

🔦 Context

We use a multi-select ComboBox in forms. Users can't use Modl+A to clear or replace what they've typed in the filter input.

🖥️ Steps to Reproduce
<ComboBox selectionMode="multiple">
  <Label>Fruit</Label>
  <Input />
  <Button>▼</Button>
  <Popover>
    <ListBox>
      <ListBoxItem>Apple</ListBoxItem>
      <ListBoxItem>Banana</ListBoxItem>
      <ListBoxItem>Cherry</ListBoxItem>
    </ListBox>
  </Popover>
</ComboBox>
  1. Type "an" so the popover opens.
  2. Press Cmd/Ctrl+A. Nothing gets selected.
Version

react-aria-components 1.22.0

What browsers are you seeing the problem on?

Firefox

If other, please specify.

No response

What operating system are you using?

MacOS 26

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Lingua principale
TypeScript
Stelle
16k
Fork
1.6k
Merge medio
2g 19h
PR unite (30g)
41

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di adobe/react-spectrum

Tutte le issue di adobe/react-spectrum

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.