ember-gesture-modifiers
ember-gesture-modifiers copied to clipboard
Some higher level events
A panleft and panright action would be awesome.
Or at least example code in the readme
My use case https://github.com/knownasilya/ember-toggle/issues/138
Yes, some more example code would be good. What do you think a specific panleft action (for example) would look like? Usually you kind of only need the distance (over the horizontal or vertical axis) and the velocity in practical applications. Not sure what would be different in a more specific action except for the removal of most info from the POJO.
Guess it doesn't add that much value, maybe just an example in the readme how to differentiate between left/right (and u/down when vertical is implemented)
I stumbled upon this addon while looking for a modern solution to detect a sort of "quick swipe left/right" gesture for sidebar open state manipulation. I'm pretty noob regarding touch events, so I couldn't figure out the appropriate way to detect the swipe but not trigger on regular horizontal scroll.
I would like to mimic iPhone native app "swipe from left" behavior, not interfering with regular scroll, so the most ideal IMO would be to check (on document body / the app wrapper div):
- a horizontal, quick swipe motion was done
- with not much vertical delta
Can you maybe provide an example for that? :pray:
Notes:
- As some browsers implement the swipe from left / right to go back / forward in history, I don't want to check if the swipe was started from the side of the screen, allowing the swipe to be triggered from anywhere on the screen.
- Triggering a regular horizontal scroll together with the swipe event is not ideal UX but I can live with it.
I stumbled upon this addon while looking for a modern solution to detect a sort of "quick swipe left/right" gesture for sidebar open state manipulation. I'm pretty noob regarding touch events, so I couldn't figure out the appropriate way to detect the swipe but not trigger on regular horizontal scroll.
I would like to mimic iPhone native app "swipe from left" behavior, not interfering with regular scroll, so the most ideal IMO would be to check (on document body / the app wrapper div):
- a horizontal, quick swipe motion was done
- with not much vertical delta
Can you maybe provide an example for that? 🙏
Notes:
- As some browsers implement the swipe from left / right to go back / forward in history, I don't want to check if the swipe was started from the side of the screen, allowing the swipe to be triggered from anywhere on the screen.
- Triggering a regular horizontal scroll together with the swipe event is not ideal UX but I can live with it.
If you only want to detect a quick swipe and not do anything with a (slow) drag you can use the velocity properties from the touchData object specified in the README. You'll have to play a bit to find a threshold for the velocity that works for your use case. Afaik ember-toggle also implements only a quick swipe, though they don't seem to look at velocity, just at if any distance is present.