3DJakob / react-tinder-card

A npm react module for making react elements swipeable like in the dating app tinder.
https://www.npmjs.com/package/react-tinder-card
MIT License
359 stars 110 forks source link

Not applying swiped function on a certain direction without preventing swipe #156

Open KarDaKar opened 1 year ago

KarDaKar commented 1 year ago

I want to programmatically prevent the change of the card if user swipes down, i need to apply function on that swipe and not the swiped() itself, how do i do it?

Something like that, but it doesn't actually prevent the card from changing

Снимок экрана 2023-08-19 в 03 58 01
3DJakob commented 1 year ago

Maybe you could use a state with the prevented directions and update it to include "down" when it should be prevented? I'm aware however that there might be a bug tied to updating this variable on the fly but I'm working on getting a fix out next release.