Leaflet: No pointerdown or mousedown events on Android Chrome > 55 and L.DomEvent.on

Created on 11 Jun 2017  Â·  14Comments  Â·  Source: Leaflet/Leaflet

No pointerdown or mousedown events on Android Chrome > 55.
Also I think this issue in Leaflet.Path.Drag is actually Leaflet bug: https://github.com/w8r/Leaflet.Path.Drag/issues/29

How to reproduce

  • Leaflet version I'm using: 1.0.3
  • Browser (with version) I'm using: Chrome 58.0.3029.83
  • OS/Platform (with version) I'm using: Android 7
  • open: http://leaflet-polyline-events.surge.sh
  • try to move blue triangle

What behaviour I'm expecting and which behaviour I'm seeing

Expecting: mousedown or pointerdown events displayed on lower part of the screen.
Have: nothing.

Minimal example reproducing the issue

  • [x] this example is as simple as possible
  • [x] this example does not rely on any third party code

Repo for example above here: https://github.com/alexshk/leaflet-test-android-chrome

Thanks

Most helpful comment

This might be a good time to revive the pointerify branch.

All 14 comments

Hi!

We've had quite a few issues related to change with pointer events from Chrome 55 and up, so I'm not surprised to see something like this.

However, I was unable to reproduce this on my Nexus 5X with Android 7.1.2 / Chrome 58. Clicking the triangle results in (synthetic) mouse up / down / click events in the bottom of the screen. I'm not able to drag the polygon, though.

Hi

Thanks, but I was checking for pointerdown/mousedown events, sorry for bad dscription. Clicks are fine, check please if you have such events while trying to drag blue triangle (no actual dragging functionality here, just checking for event firing). Thanks

@alexshk this is what it looks like clicking the polygon on my Nexus 5X:

image

So, as you can see there's mousedown as well as mouseup and click. This is not what you're seeing?

@perliedman if I tap on triangle, then yes -- I see the same. But I want to drag blue triangle. Check with desktop browsers and you'll see result I need.

Alright, now I finally see the issue. Will have to look closer.

BTW, this is reproducible in Chrome devtools on desktop with device emulation enabled.

This might be a good time to revive the pointerify branch.

I have tested the following and can confirm that the bug is reproducible on both:

Android 4.4.2, Chrome 58
Android 6.0.1, Chrome 55

The fix by @alexshk seems to be working. Any updates on whether or when it will be fixed in Leaflet?

As asked above, when will this be fixed? The issue can still be produced on Android 6, Chrome 68, Leaflet v. 1.3. Thx.

Ok, I've found solution.
https://github.com/Leaflet/Leaflet/blob/d843c3b88486713827d7e860b58bdba75bfbd5a2/src/map/Map.js#L1327-L1328
Here we need to add 'pointerdown pointerup ' (or 'touchstart touchend ').

But I'm not sure: should we just add these 2 events, or make whole list customizable?

According to docs, we have limited list of supported events.
touch* and pointer* events are not implemented.

As for mousedown: it should not be fired on touch-dragging, because it is just 'compatibility mouse event', see specs.

So current behavior is valid, thus I am closing this issue.

@alexshk @nikkon226 @data-ux @joakimgunst @Damorck
Feel free to request support for additional events (in separate issue), describing your use cases.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onethread picture onethread  Â·  3Comments

piehei picture piehei  Â·  3Comments

jcarenza picture jcarenza  Â·  3Comments

broofa picture broofa  Â·  4Comments

zdila picture zdila  Â·  3Comments