ember-gesture-modifiers icon indicating copy to clipboard operation
ember-gesture-modifiers copied to clipboard

Some higher level events

Open knownasilya opened this issue 5 years ago • 6 comments

A panleft and panright action would be awesome.

knownasilya avatar Sep 25 '20 17:09 knownasilya

Or at least example code in the readme

knownasilya avatar Sep 25 '20 17:09 knownasilya

My use case https://github.com/knownasilya/ember-toggle/issues/138

knownasilya avatar Sep 25 '20 17:09 knownasilya

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.

nickschot avatar Oct 02 '20 12:10 nickschot

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)

knownasilya avatar Oct 03 '20 03:10 knownasilya

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.

abel-n avatar Nov 17 '21 07:11 abel-n

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.

nickschot avatar Nov 25 '21 11:11 nickschot