-
Notifications
You must be signed in to change notification settings - Fork 0
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
Focus should be managed between markers and popups #3
Comments
I see that some of this has been addressed (cf. demo). Is it considered closed? On a related note, popups should probably close when pressing ESC, and perhaps they should also trap focus (modal dialog pattern)—thoughts? |
Hi @robinmetral, Thanks for the comments. To address your points:
Yes. I need to tidy up!
Good point. I've raised this in #22.
In the general case, pop-ups triggered when activating a map marker should not be modal, so I don't think they should trap focus. (FYI, in Leaflet/Leaflet/issues/7968, a contributor argues that map pop-ups are not always dialogs.) If a modal dialog was needed for a specific application, you could extend the built-in Popup class. I hope that helps. Yours, Nick P.S. I'm always interested to know if and/or where you're thinking of using You may also find Leaflet.translate useful. |
Thanks for the detailed follow-up! Not using the plugin at the moment, still evaluating mapping libraries options for a personal project. I definitely will if going for Leaflet (plus I'd be happy to join efforts improving a11y, code and docs) 🙂 Cheers! |
Problem
Focus order should be logical and meaningful. At present, when a popup is opened in Leaflet, keyboard focus is not placed on the popup. When the popup is closed, focus is not placed back on the triggering marker element.
Solution
On popup open:
On popup close:
Leaflet API / plugin dev. notes:
popupopen
andpopupclose
Leaflet events.The text was updated successfully, but these errors were encountered: