-
Notifications
You must be signed in to change notification settings - Fork 147
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
Open menu on right swipe #150
Comments
Ah I found something! In the
which appears to be the absolute start position! 👍 Is this indeed the way to go here? :) EDIT: Oh no.... I was completely wrong |
@Nasicus Check this codesandbox.io example out and tell me what you think. https://codesandbox.io/s/swipeable-sidebar-using-react-burger-menu-6urqx "Swipe right" inside the gray dashed area and it opens the menu. |
Hey @hartzis thank you so much for your effort! I think the initalXY would be great! Also thanks for the codebox. I tried something similar, however the problem is now, that the swipeable div is before the text and therefore the text behind it is not selectable anymore. In my case there is also stuff there which has to be clickable. |
I have the following situation:
I have an existing project which already has a responsive-design. But one feature it's missing, is to open the menu on "right swipe" (on the moment you have to click on the burger).
The page is structured quite "normal".
So what I tried to do is to replace one of my outer most-outer-
div
s with the theSwipeable
Component. Then I simply listen for theonSwipedRight
event and open the menu when this happens. Quite simple and working like a charm.However what I really would like is to only listen to the "swipedRight" event when you swipe on the left part of the screen:
For this I hoped that in the
EventData
you receive something likex-start-absolute
(basically the start position depending on the whole screen size). With this value I could then calculate if the users started swiping from the "yellow"-area. However as far as I can see there is nothing like this in there.And I could not yet find another good way.
I saw #79, however I don't understand how this should work: If I place an extra element on the left side, it will either be before the other elements (and therefore make the left side "unclickable" / unusable) or behind it and then never be triggered at all.
Am I missing something? Is my approach wrong anyway?
The text was updated successfully, but these errors were encountered: