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

Keyboard enter on focused cluster won't zoom into it #940

Closed
5 tasks done
cftarbay opened this issue Jan 16, 2019 · 4 comments
Closed
5 tasks done

Keyboard enter on focused cluster won't zoom into it #940

cftarbay opened this issue Jan 16, 2019 · 4 comments

Comments

@cftarbay
Copy link

  • I'm reporting a bug, not asking for help
  • I'm sure this is a Leaflet.MarkerCluster code issue, not an issue with my own code nor with the framework I'm using (Cordova, Ionic, Angular, React…)
  • I've searched through the issues to make sure it's not yet reported

How to reproduce

  • Leaflet version I'm using: 1.4.0
  • Leaflet.MarkerCluster version I'm using: 1.4.1
  • Browser (with version) I'm using: Chrome 71.0.3578.80
  • OS/Platform (with version) I'm using: Windows 10 1709

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

When I tab across and focus on clusters in a map, and then hit enter to zoom in on one as I would on a click, it does not work when using leaflet version 1.4.0 or 1.3.1. If I change my version of leaflet back to 1.0.3, it does work as expected.

Minimal example reproducing the issue

I just changed the leaflet version used in the 388 point example in this library to version 1.4.0, and this produces the bug. I put it into plnkr, and if you change the version back and forth you can see the issue.

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

Using plnkr:
https://plnkr.co/edit/GJErPcYCWtqGz8lWqHl5?p=preview

@danzel
Copy link
Member

danzel commented Jan 21, 2019

Hm, this should be handled by leaflet for us.

Does this reproduce with standard leaflet?
If you make a marker and add a click listener, can you focus it and use enter to click it?

@Schleuse
Copy link

The answer is kind of...
It's currently only handled by L.Popup. Leaflet doesn't emit a click-Event when Enter is pressed.

https://github.com/Leaflet/Leaflet/blob/37d2fd15ad6518c254fae3e033177e96c48b5012/src/layer/Popup.js#L528

I've build an example to show the current behavior:

https://next.plnkr.co/edit/gwHaLQFZnfWZfo8P

@danzel
Copy link
Member

danzel commented Mar 17, 2019

Thanks.
This sounds like a leaflet regression/change then. Please open an issue at leaflet/leaflet and link them back here.

As a workaround you could add a keypress listener and call the zoomTo... method when an enter key is pressed.

@zpon
Copy link

zpon commented Jul 25, 2019

Are there any news regarding this? Has a bug been filed against the Leaflet project?
Just did a quick test, this hasn't worked since version 1.0.3 of Leaflet.

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