Skip to content
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

Fix click with pointer compatibility #1121

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

snowystinger
Copy link

What:

Closes #1119
This ensures that click and double click are still fired even when preventDefault is used on pointerdown to prevent mouse compatibility events.

Why:

The browsers all work this way, as seen here https://codesandbox.io/s/aged-voice-xjf3dw

How:

Click is currently handled in the pointer/mouse class. This is fine, however there is some tracking there which tells us if we can fire the click/double click. As a result I pushed the check for isPrevented down into the mouse actions and only prevented the firing of the relevant events, not everything like it was before.

Checklist:

  • Documentation (N/A)
  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b0ad70a:

Sandbox Source
userEvent-dom Configuration
userEvent-react Configuration
damp-wind-dnn0f6 PR
funny-blackburn-t7h50g Issue #1119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Click and DoubleClick not fired if pointerDown has preventDefault
1 participant