Skip to content
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

Сan not scroll list of layers in Google Chrome #5277

Closed
temapanf opened this issue Jan 24, 2017 · 7 comments
Closed

Сan not scroll list of layers in Google Chrome #5277

temapanf opened this issue Jan 24, 2017 · 7 comments
Assignees
Milestone

Comments

@temapanf
Copy link

temapanf commented Jan 24, 2017

  • Leaflet version I'm using: 1.0.2
  • Browser (with version) I'm using: Chrome & FF
  • OS/Platform (with version) I'm using: Windows 10

I can not scroll list of layers in layers control. Error in chrome 55, but all is well in Firefox 50. View gif. In Leaflet 0.7.3 works fine.

Chrome

Firefox

@IvanSanchez
Copy link
Member

This might be related to the troublesome PointerEvent logic of #5180.

Just in case, can you try with Leaflet 1.0.3?

@temapanf
Copy link
Author

Screen from http://leafletjs.com/examples/layers-control/example.html, which is used 1.0.3

@IvanSanchez
Copy link
Member

Can confirm. I've left a playground at https://playground-leaflet.rhcloud.com/vifa/edit?html,output

@IvanSanchez
Copy link
Member

According to https://dom.spec.whatwg.org/#dispatching-events , step 18.1, the behaviour that Chrome>=55 exhibits is the right one: if any DOM parent of a element runs preventDefault() on the event while it is bubbling up (which is steps 12-13), an event flag is set, and that flag must (or should) be checked at the end of the browser's event handling logic.

@IvanSanchez IvanSanchez added this to the 1.1 milestone Jan 24, 2017
@IvanSanchez
Copy link
Member

A simple example like at http://jsbin.com/mefojojugi/edit?html,output displays the proper behaviour in other browsers, so I don't know which parts of Leaflet made this work until now. 😕

@wladich
Copy link
Contributor

wladich commented Jan 25, 2017

I think this is beacause scroll propagation is disabled only for not-touch browsers:
https://github.com/Leaflet/Leaflet/blob/v1.0.3/src/control/Control.Layers.js#L166

But in last chrome version L.Browser.touch is true for desktop version.

This is sad as this flag is used in many places. For example zoom control is now enlarged in desktop Chrome (see gifs in issue)

@IvanSanchez
Copy link
Member

Good catch! I was able to make a cleaner PR.

Regarding L.Browser.touch in Chrome, do read #5266 and #3944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants