downshift-js / downshift-js/downshift

ItemClick doesn't work with stateReducer inside an iframe

Open
#1,237 9 comments 3 reactions 0 assignees View on GitHub
bug help wanted needs investigation
Dominant language
JavaScript
Stars
12.3k
Forks
936
PR merge metrics
No merged PRs in 30d

Description

- `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**:

![ezgif-4-44bd487af032](https://user-images.githubusercontent.com/1286563/107861667-6aa04d80-6e58-11eb-9230-2b9646ba73fa.gif)

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?

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.