Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: prevent vertical dragging #44

Open
firma777 opened this issue Apr 13, 2021 · 8 comments
Open

Feature request: prevent vertical dragging #44

firma777 opened this issue Apr 13, 2021 · 8 comments

Comments

@firma777
Copy link

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 firma777 changed the title Feature request: prevent vertical drag Feature request: prevent vertical dragging Apr 13, 2021
@leancer
Copy link

leancer commented Apr 15, 2021

having same issue.

@3DJakob
Copy link
Owner

3DJakob commented May 15, 2021

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
Copy link
Owner

3DJakob commented May 15, 2021

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.

@muhammedogz
Copy link

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

@anonimitoraf
Copy link

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

Thanks for this suggestion @3DJakob ! I'll fork this repo and try it out.

@nikkizol
Copy link

@anonimitoraf did you mange to fix this?

@nikkizol
Copy link

need to able to scroll vertically, any solution?

@coreyarch4321
Copy link

I would appreciate a solution here too. This seems to be an important area of improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants