react-tinder-card icon indicating copy to clipboard operation
react-tinder-card copied to clipboard

Feature request: prevent vertical dragging

Open firma777 opened this issue 4 years ago • 8 comments

Imagin we have a cards that fulfill most of the mobile display area. In that case we have not a chance to scroll page up / down becasue instead of scrolling the page you can only swipe the card. It would be greate to have an ability to prevent vertical dragging.

firma777 avatar Apr 13 '21 12:04 firma777

having same issue.

leancer avatar Apr 15 '21 05:04 leancer

I see the problem! This, however, is a hard one to solve because even if we implement so that the cards won't accept vertical dragging the event will already have been triggered and therefore it will still prevent the user from scrolling. And even if you would send back the drag then it would make the code complicated since a ref would need to be used to push props upstream. Perhaps you could solve it by making a div on top of the cardstack and intercepting drag events and only passing them through when they do not start dragging downwards however this will likely cause a lot of other issues.

The best way to solve this would probably be to make the card swipe a horizontal scroll area all together but that would require a completely different approach than this module uses.

Do you have any proposed way of implementing this?

3DJakob avatar May 15 '21 10:05 3DJakob

Perhaps changes could be made to the prevent.default on the touchStart event as mentioned here. Setting that dynamically depending on what direction the finger is headed could be a solution.

3DJakob avatar May 15 '21 10:05 3DJakob

Is there any solution for this? I wonder it too. It should not be prevented for scrolling down the page.

muhammedogz avatar Jul 03 '22 12:07 muhammedogz