Trendyol / react-carousel

Lightweight carousel component for react
https://trendyol.github.io/react-carousel
MIT License
300 stars 433 forks source link

ScrollingCarousel does not respond to click sometimes #78

Open jeremylin8 opened 2 years ago

jeremylin8 commented 2 years ago

Describe the bug

Hello,

I spot this bug when using ScrollingCarousel component. Sometimes, when click on an item, it doesn't respond to the click event. I think it's caused by the mouseMove and mouseDown event both fired. Could you please take a look at this and fix if that's possible? Thank you so much.

Reproduction

https://user-images.githubusercontent.com/7519225/164739212-6e702305-85f0-45f0-af18-41945e0d5e3a.mov

System Info

System:
    OS: macOS 11.5.1
    CPU: (8) arm64 Apple M1
    Memory: 100.41 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.10.0 - /opt/homebrew/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 7.24.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 100.0.4896.127
    Firefox: 98.0
    Safari: 14.1.2
  npmPackages:
    @trendyol-js/react-carousel: ^2.0.1 => 2.0.1

Used Package Manager

npm

Logs

No response

Validations

hasangenc0 commented 2 years ago

@jeremylin8 did you try the triggerClickOn prop? if you set triggerClickOn={10} it will trigger click events even if you move your mouse 10px. (you should update the version v3.0.0-beta.4)

jeremylin8 commented 2 years ago

@hasangenc0 I think triggerClickOn prop is only in Carousel component. Can you guys please add it to the ScrollingCarousel component as well?

hasangenc0 commented 2 years ago

I think we can. let's see if we have free time to do it this week.

jeremylin8 commented 2 years ago

Hey @hasangenc0, any updates on this feature? Thanks a lot!

GautamGupta commented 2 years ago

+1. Running into the same issue with ScrollingCarousel