Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Added support for carouselTap message to be emitted when slide clicked/tapped #321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/directives/rn-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,11 @@
function swipeEnd(coords, event, forceAnimation) {
// console.log('swipeEnd', 'scope.carouselIndex', scope.carouselIndex);
// Prevent clicks on buttons inside slider to trigger "swipeEnd" event on touchend/mouseup
if (event && !swipeMoved) {
if (event && !swipeMoved ) {
// Don't emit on cancel
if( coords.y !== undefined ) {
scope.$emit( 'carouselTap', event.target );
}
return;
}
unbindMouseUpEvent();
Expand Down