-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select doesn't respond to click event through code #19250
Comments
See #18655. |
Interesting. |
This is indeed a bug. The native select does not open if the right mouse button is down. Probably only responds to left mouse button down. |
i'm not using react-testing library so i didn't understood how #18655 can help me. what do you think i can do to trigger the click event? |
@dudif Trigger a mouse down. |
In PR #17978 To resolve, I may suggest to check if primary button clicked in the |
@oliviertassinari , thank you! This is exactly I've suggested to implement. I'll do it |
Hi, i'm trying to test my select component with puppeteer.
Current Behavior 😯
i'm trying this:
document.querySelector('[data-testid="my-select"] [role="button"]').click()
and it seems to do nothing.
it worked before in version 4.6.1
also it seems that since that version right click on Select also open the component what didn't happened in the version 4.6.1
Expected Behavior 🤔
document.querySelector('[data-testid="my-select"] [role="button"]').click()
should trigger the click event on the select and open the component
Context 🔦
this issue effecting on all my tests (unit tests, ui tests).
because i can't find a way to trigger click event on the select through code.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: