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

Bad default value for lastClickTime #6496

Closed
MRamonLeon opened this issue Mar 16, 2023 · 0 comments
Closed

Bad default value for lastClickTime #6496

MRamonLeon opened this issue Mar 16, 2023 · 0 comments

Comments

@MRamonLeon
Copy link
Contributor

MRamonLeon commented Mar 16, 2023

In a recent Cypress test we faced an issue because of this:

lastClickTime: now(),

My test tap the active image. The test runs very quickly and Swiper interprets that this tap event is actually a double tap because the time passed between this tap and the previous click stored at lastClickTime is less than 300 ms.

That's not true, there was only a single tap, but since the previous tap is stored there and is initialized to now(), Swiper thinks there was two taps.

It could be resolved by initializing the lastClickTime to 0 for example.

I created a simple PR to tackle that. Don't hesitate to come up with a different solution. #6497

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

1 participant