-
Notifications
You must be signed in to change notification settings - Fork 148
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
Click or tap through swipeable component #215
Comments
@ArinCantCode Thanks for posting the question/issue. I'm genuinely intrigued by this use case and would love to see an example we could work with and test against. Do you think you could setup a codesandbox example of this use case please?
📓 UPDATE v6 has been released - https://github.com/FormidableLabs/react-swipeable/releases/tag/v6.0.0 And there is a new codesandbox we can fork from - example react-swipeable codesandbox |
Hi I'm having the same problem. For example when the carousel item is something like |
Any workaround for this? I have a similar issue in my carousel with ads. The swipes work well but my ads become unclickable. Something like this:
|
@kayeew Could you try the new v7 to see if that helps? if not could you try to create a codesandbox.io example that we can use to iterate on? I'm also starting to suspect that there maybe an issue/bug related to these lines of code when Lines 189 to 196 in 3e417f5
@kayeew also could you clarify the sceneario you're seeing a bit more please?
|
Something like this: https://codesandbox.io/s/react-swipeable-bug-6ej07l?file=/app/test.tsx I noticed preventDefaultTouchmoveEvent is no longer in v7. The swiping and onclick works well now in my example but is there a way to not trigger an onclick event when user is swiping. The onclick event is currently still triggered on swipe left or right in my example. |
@kayeew Thank you for the example! I tried it out a bit and I can replicate the issue, but only for a "mouse swipe"/ The issue does not appear to be happening for "touch swipes"/ When I use the example in dev tools mobile mode and on my mobile device everything appears to be working correctly. Is desktop mouse swiping an important aspect of what you're building? just curious. 📓 Notes:
|
Hey all, i have a similiar issue. I want to use this package for opening a hamburger-menu with a swipe gesture, i defined a div with 30% width and a full height as "swiping area" - but all buttons on all my pages don't work of course when the layer is on top of them. Is there a workaround to fix this? |
the issue from t-kietzmann is exactly my issue too https://codesandbox.io/s/react-swipeable-document-swipe-example-1yvr2v yes. that works as i would expect it to. |
@t-kietzmann & @jalatiphra Could you try attaching a listener to the https://github.com/FormidableLabs/react-swipeable#how-can-i-add-a-swipe-listener-to-the-document |
I have exactly the same issue as @t-kietzmann and @jalatiphra. Attaching a listener to the document works as one would expect but creates a whole new set of problems. While checking if the initial x position is in a certain range of the screen is easy, dialogs are way worse. Because dialogs pop over the whole page and don't prevent the event from firing, you are able to swipe open the menu with a dialog open, which is definitely something that should be prevented. When using an invisible div, this wouldn't be a problem, but when using the document, I now have to use a context to track if any dialog was opened and block the hamburger menu based on that. That solution works fine, but compared to the invisible div where it would work out of the box it just seems a little unnecessarily complicated. Using a div that does pass through mouse events would be the preferred solution by far. |
Hi, i have my swipeable component which works great, but in some cases i have buttons under that div on which i detect the swipe and that causes the button to not being triggered when the user taps / click on it.
is there a way to not stop propagation on the swipeable component when my user taps so that the tap also works on elements underneath it?
The text was updated successfully, but these errors were encountered: