Skip to content

#517: Fix emulated touch never changing slide#556

Merged
leandrowd merged 3 commits into
leandrowd:masterfrom
renancleyson-dev:emulate-touch-not-changing-slide
Feb 12, 2021
Merged

#517: Fix emulated touch never changing slide#556
leandrowd merged 3 commits into
leandrowd:masterfrom
renancleyson-dev:emulate-touch-not-changing-slide

Conversation

@renancleyson-dev

@renancleyson-dev renancleyson-dev commented Feb 5, 2021

Copy link
Copy Markdown
Contributor

Fixes #517.

The cause

The handleClickItem is called when the mouse click is released on the end of a swipe, which sets the selectedItem state to the current slide and makes it impossible to change the slide through a swipe on non-touch devices since these devices will always trigger a click event while swiping.

Solution

It sets the cancelClick state to false on onSwipeForward and onSwipeBackwards, which prevents the handleClickItem to set the selectedItem state to the swiped item.

@kylesierens

Copy link
Copy Markdown

@leandrowd How often to you accept PR? When could we expect this one to be merged?

@leandrowd

Copy link
Copy Markdown
Owner

Sorry, I'm a bit time poor ATM. Will try to get to it this week.

@leandrowd

Copy link
Copy Markdown
Owner

Please test it thoroughly so I only need to press the merge button and publish it... This will make it easier. Let me know once you are confident this is ok to be merged.

@renancleyson-dev

Copy link
Copy Markdown
Contributor Author

I believe it can be merged now.

@leandrowd leandrowd merged commit 74e1d96 into leandrowd:master Feb 12, 2021
@leandrowd

Copy link
Copy Markdown
Owner

Published to npm as 3.2.12

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.

Swipe on non-touch device is a bit weird

3 participants