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

Duplicate mouse events when acceptsFirstMouse: true #151

Open
oscarmarcelo opened this issue Jun 30, 2020 · 1 comment
Open

Duplicate mouse events when acceptsFirstMouse: true #151

oscarmarcelo opened this issue Jun 30, 2020 · 1 comment

Comments

@oscarmarcelo
Copy link

Issue

When acceptsFirstMouse: true, if the clicked element also has attached events to the corresponding mouse event used to simulate the first click (See dispatch-first-click.js), it will end up triggering them twice, because the first click trick will also trigger them synthetically.

This is a specially unwanted behaviour when the said element is disabled (e.g. <button>), which shouldn't trigger click events.

Possible Fixes

The code used to run this should also check for the disabled state.
Also, it needs check if the element already has attached events to avoid making them run twice.

I would PR something for this, but honestly I haven't come up with a good solution to address the second part without affecting some obscure cases.
I can still send a PR and wait for someone help me, tough...

@mathieudutour
Copy link
Member

We can maybe fix the first part and think about the second with a separate PR?

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

No branches or pull requests

2 participants