downshift-js / downshift-js/downshift
ItemClick doesn't work with stateReducer inside an iframe
- Lingua principale
- JavaScript
- Stelle
- 12.3k
- Fork
- 936
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
- `downshift` version: 6.1.0
- `node` version: codesandbox
- `npm` (or `yarn`) version: codesandbox
**What you did**:
I tried to combine the [default example](https://github.com/downshift-js/downshift/tree/master/src/hooks/useMultipleSelection#usage) of multiple select and [that](https://github.com/downshift-js/downshift/tree/master/src/hooks/useCombobox#statereducer) state reducer part to achieve my dropdown not being closed after item click. I also wrap it in an iframe(using `react-frame-component`), cause I have such setup for my components in the documentation environment.
**What happened**:

ItemClick change type doesn't trigger stateReducer, which causes menu to close, although InputKeyDownEnter does.
**Reproduction repository**:
https://codesandbox.io/s/gallant-meadow-660h4?file=/src/index.js
**Problem description**:
`stateReducer` doesn't fire with `useCombobox.stateChangeTypes.ItemClick` inside an iframe
**Suggested solution**:
I could implement the fix with some advise help. Do you have any idea, what causes this?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con la riproduzione CodeSandbox collegata e confronta l’esempio di selezione multipla con l’esempio di stateReducer di useCombobox, concentrandoti su useCombobox.stateChangeTypes.ItemClick all’interno dell’iframe. Verifica perché ItemClick non raggiunge stateReducer mentre InputKeyDownEnter sì. Il lavoro è completato quando il reducer riceve ItemClick nell’iframe e il menu rimane aperto come configurato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, react
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100