downshift-js / downshift

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

Home Page:http://downshift-js.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`onSelectedItemChange` triggers multiple times when `onMouseMove` and `onClick` happens in the same frame

jeffijoe opened this issue · comments

  • downshift version: 9.0.4
  • node version: 20
  • npm (or yarn) version: 10.5.0

Relevant code or config

It's related to onSelectedItemChange

What you did: Use Playwright for testing a combobox.

What happened: The onSelectedItemChange is triggered twice.

Reproduction repository:

I based the reproduction on the official example for multi-selects.

https://github.com/jeffijoe/mobx-react-downshift-issue

Problem description: onSelectedItemChange triggers multiple times when onMouseMove and onClick happens in the same frame

Suggested solution: Prevent calling onSelectedItemChange twice in the same frame

as long as this works for the end user, I would consider it closed. please reopen if you can repro as a normal user. thanks!