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

Issue 610: Prevent swipe logic from taking over when no swipe was made #645

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

mariano-formidable
Copy link
Member

Description

This PR prevents swipe logic from running when a swipe of 0 distance (meaning just tapping the screen) has occurred.

Fixes #610

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Existing tests pass. Manually tested.

Screenshots

The little numbered button under each slide is a button within the carousel that changes the slideIndex on click, before they didn't work (on emulated mobile), now they do:
mobile-button

@@ -561,7 +563,7 @@ export default class Carousel extends React.Component {
this.previousSlide();
}
}
} else {
} else if (touchLength > 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super small fix, just making sure when a touch happens, it has some distance before we trigger the goToSlide to slide back to the currentSlide.

@mariano-formidable mariano-formidable changed the title [WIP] Issue 610: Prevent swipe logic from taking over when no swipe was made Issue 610: Prevent swipe logic from taking over when no swipe was made Jan 23, 2020
@sarmeyer
Copy link
Member

works like a charm! Thank you!

@sarmeyer sarmeyer merged commit 2e8bec7 into master Jan 28, 2020
@sarmeyer sarmeyer deleted the fix/610-slides-switching branch March 12, 2021 23:05
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.

Carousel not switching slides on emulated mobile devices in Chrome
2 participants