-
Notifications
You must be signed in to change notification settings - Fork 240
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
Click and DoubleClick not fired if pointerDown has preventDefault #1119
Labels
bug
Something isn't working
Comments
snowystinger
added
bug
Something isn't working
needs assessment
This needs to be looked at by a team member
labels
Apr 20, 2023
snowystinger
changed the title
Click compatibility events cannot be prevented
Click and DoubleClick not fired if pointerDown has preventDefault
Apr 25, 2023
here's a test for double click as well
|
3 tasks
ph-fritsche
removed
the
needs assessment
This needs to be looked at by a team member
label
May 11, 2023
I just ran into this bug as well - any way we can get a review of @snowystinger 's PR prioritized sometime soon? Looks like the PR and this issue's been open for a bit without eyes on it 😞 |
just a friendly bump, is there anything you need in order to consider this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction example
https://codesandbox.io/s/aged-voice-xjf3dw
Prerequisites
Expected behavior
Both should fire
Actual behavior
The test does not fire click
I'll provide more in additional context because the codesandbox behaves a little differently than when I run this repos tests with two tests I think cover the behavior
User-event version
14.4.3
Environment
Testing Library framework:
@testing-library/[email protected]
JS framework:
[email protected]
Test environment:
[email protected]
DOM implementation:
[email protected]
Additional context
I think these are the behaviors that would be expected, assuming I wrote them correctly.
In english:
calling user.click with preventDefault on pointerDown should result in pointerDown, pointerUp, and click being fired
calling user.pointer with preventDefault on pointerDown should also result in pointerDown, pointerUp, and click being fired
I think this is handled here https://github.com/testing-library/user-event/blob/main/src/system/pointer/index.ts#L105 but I've checked and isPrevented is true. So I'm not sure why the mouse events are getting fired.
It looks like including a 'click' is part of system/pointer/mouse. So guessing that would need to be pulled up and out of there.
The text was updated successfully, but these errors were encountered: