Closed jeffijoe closed 4 months ago
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!
To me it seems the same issue happens on my project. It also happens only when e2e testing using Playwright and unfortunately multiplied events caused enough trouble to require a hack to ignore repeated events in a single rendering pass in the React app I'm working on. The application code isn't as clean as I'd prefer and things getting really bad is a sum of many parts but still it would be nice if the importance of Playwright and e2e testing was reconsidered.
downshift
version: 9.0.4node
version: 20npm
(oryarn
) version: 10.5.0Relevant 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 whenonMouseMove
andonClick
happens in the same frameSuggested solution: Prevent calling
onSelectedItemChange
twice in the same frame