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

Fix click event handler on button within slide element #475

Merged
merged 1 commit into from
Jan 9, 2019
Merged

Conversation

sarmeyer
Copy link
Member

@sarmeyer sarmeyer commented Jan 8, 2019

Description

This PR fixes the click event handler for buttons that are within the slide elements. Clicking a button was firing the handleSwipe method, when it should only fire it's own onClick handler. By checking onMouseUp if there is a direction on the click event, we can avoid unnecessary swipe method calls.

Fixes #462

Type of Change

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

How Has This Been Tested?

Add a button to the slides with an onClick handler that changes the slideIndex

Checklist: (Feel free to delete this section upon completion)

  • [x ] My code follows the style guidelines of this project (I have run yarn lint)
  • [ x] New and existing unit tests pass locally with my changes (I have run yarn test and yarn test-e2e)
  • [ x] I have performed a self-review of my own code
  • [ x] My changes generate no new warnings

@sarmeyer sarmeyer merged commit 98a5907 into master Jan 9, 2019
@sarmeyer sarmeyer deleted the issue-462 branch January 15, 2019 22:21
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.

Externally controlled carousel will not advance to next slide
1 participant