Closed SMH110 closed 4 years ago
Hi @SMH110,
I answered this during office hours today: https://www.youtube.com/watch?v=ph_dQoIKzoY
Here's an example test: https://github.com/downshift-js/downshift/blob/23f37157dbd4f27433ac92406b7089c15d056bcd/src/__tests__/downshift.lifecycle.js
Hi, I have a dropdown component which should close when a user clicks outside the dropdown. Here is the implementation:
Here is my test
I found this solution on stackoverflow
But, this made the test flaky!
What is the best way to implement
outsideclick
and how to test it?Thanks