bikehopper / bikehopper-ui

Friendly bike+transit directions (frontend)
Other
26 stars 1 forks source link

Fix long-press to select points on Android #271

Closed graue closed 1 year ago

graue commented 1 year ago

Apparently Chrome for Android, unlike Safari for iPhone, fires a series of touchmove events even when you've only moved your finger an imperceptible amount, so we were failing to detect any long-press events.

We already have code in the map overlay to see if a touch move is far enough not to consider it a "click," so I factored this out and reused it.

Not yet actually tested on Android. @abhumbla, can you check this out and see if it works for you?

Also, I discovered a bug where (on iPhone Safari) the context menu could trigger while dragging a marker around, so fixed that too.