keen-slider icon indicating copy to clipboard operation
keen-slider copied to clipboard

dragEnded() fired on slide click without confirming if its drag (dragChecked)

Open ponciusz opened this issue 3 years ago • 2 comments

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

ponciusz avatar Mar 30 '22 10:03 ponciusz

Yes, you are right. I will then replace dragChecked with dragStarted and then remove dragChecked as it will no longer make sense.

rcbyr avatar Apr 17 '22 19:04 rcbyr

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

ponciusz avatar May 13 '22 10:05 ponciusz