react-responsive-carousel icon indicating copy to clipboard operation
react-responsive-carousel copied to clipboard

emulateTouch trigger click event when swipe

Open xzysun opened this issue 6 years ago • 2 comments

When use emulateTouch with swipeable on PC & chrome, the onClickItem callback trigger after onSwipeEnd called if the swipe distance is not enough to goto next/previous page.

see the demo: https://codesandbox.io/s/react-responsive-carousel-06me4

I see there is a cancelClick in the code, I think it should to be set false when swipe end with a delay of transitionDuration https://github.com/leandrowd/react-responsive-carousel/blob/dae409dba878adc0001d9eb15b647914e05b8119/src/components/Carousel.tsx#L459-L466

something like

setTimeout(() => {
     _this.setState({ cancelClick: true });
}, _this.props.transitionTime);

xzysun avatar Jun 28 '20 10:06 xzysun

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 02 '21 05:07 stale[bot]

@xzysun I am facing the same issue. were you able to solve this?

saurabhkacholiya avatar Jul 16 '21 08:07 saurabhkacholiya