-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 double click behavior is different from native #1551
base: develop
Are you sure you want to change the base?
Fix double click behavior is different from native #1551
Conversation
// difference: | ||
dblClick = hitItem === clickItem | ||
&& (Date.now() - clickTime < 300); | ||
downItem = clickItem = hitItem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sasensi this removes the check for clicks on the same item entirely... Are you sure we want this? Is it fine to do so because double-clicks are only considered within 3 pixels distance? But what if the first click was on a different item?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're right, I hadn't noticed that. But even if I don't manage to make it fail practically, from a theoretical point of view, it would be better to also check that item is the same for both clicks.
In new version, I also ensure that triple clicking an item don't produce 2 double click events.
47de271
to
b16813c
Compare
@sasensi this looks good now! Could you add unit tests for it also, now that we have the infrastructure for them in place? |
b16813c
to
d5420a0
Compare
@sasensi could you rebase this on top of |
…-behavior-is-different-from-native
3cc7fa3
to
a9ebe47
Compare
39b63a1
to
b90a711
Compare
4a6bf6f
to
0f4afc5
Compare
Description
Changes based on @DSnopov suggestion in #1451.
Related issues
Checklist
npm run jshint
passes)