keen-slider
keen-slider copied to clipboard
dragEnded() fired on slide click without confirming if its drag (dragChecked)
example below:
probably expected behaviour would be dragEnded should first check if dragChecked than emit this event otherwise its triggering it even for clicks which are not drags.
https://codesandbox.io/s/wild-architecture-stftz0?file=/src/App.tsx
Yes, you are right. I will then replace dragChecked with dragStarted and then remove dragChecked as it will no longer make sense.
i managed to cheat it little bit with local state
dragChecked() {
dragChecked.current = true;
},
dragEnded() {
if (dragChecked.current) {
fireTracking('carousel_drag');
dragChecked.current = false;
}
},
as its always re-rendering that phase its working ok