-
Notifications
You must be signed in to change notification settings - Fork 16
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
Differentiating between the user and code setting focus #577
Comments
For checking if the map is focused there is a |
2021-11-16.09-50-20.mp4That's the behavior I see, but the variable afterward doesn't seem to update although the internal behavior that uses that variable does (not sure why there would be a difference at the moment). Also the moment you go to the console the map loses focus so a better way to check the variable state is adding console.log to the code. |
Console logging gives the same result and I do get the same behavior as you with the crosshair. |
The last part is by design, you only want the crosshair, outline and announcements (unless, it was decided otherwise) when using keyboard, not mouse. The crosshair for example provides no value if you already have a mouse that can click anywhere including the center on the map. |
Ah makes sense. For announcement Peter did want it to announce location when the mouse dragged the map as well, so I guess it makes the most sense to also announce when focused/unfocused through clicking. |
When checking for the active element, one thing I had to account for in the past is that the active element of the DOM is different than the active element of the shadowDom. i.e. if you have the zoom |
In #533 I made it so that the screen reader announces the location when the map is focused. However, we seem to use .focus() on the map container a lot, for example, when clicking a feature link the screen reader will announce the focus message even though the user did not focus the map themselves. There's now a mix where either the user focuses on the map or we forced the focus through JS but they both fire the same event. Should we introduce a new event for when the user focuses or try and have a different approach instead of forcing focus changes or something else?
The text was updated successfully, but these errors were encountered: