-
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
Adding tabbing navigation and accessibility to map #270
Conversation
The features are indistinguishable to someone relying on a screen reader as they don't have an accessible name.
|
When using the NVDA screen reader it's not possible to open popups by pressing Enter or Space when a feature has focus. This works on other elements such as controls, supposedly because they're standard interactive elements. |
I see that the
That's a problem. Open to suggestions to achieve this. Maybe we should open the popup when the feature receives focus, and dismiss it on blur? |
I think opening a pop up on focus alone might be an annoying interaction to have with a webpage. Adding a title element seems like a good solution based off: https://www.w3.org/TR/SVG11/struct.html#DescriptionAndTitleElements . |
I'm not saying you're wrong, just want to think about this a bit here. When a user clicks or touches a feature when the map isn't in "focus mode", the feature either pops up a balloon or if there's a query available it pops up a balloon after receiving the response. Presumably (I am presuming) tab-to-focus a feature is the equivalent operation to touching it for a sighted person, so the user wants to hear the properties if they're using a screen reader. Given the extremely generic properties model that |
I think in the short term, we could generate an accessible name on the element that has the value |
Tab-to-focus is more of a discovery phase (perhaps tedious, depending on the amount of features), where e.g. "focus mode" is a term to describe one of few modes in screen readers but I take it you're referring to when the reticle is visible? This mode currently has some usability issues:
(Also popups aren't announced when opened. This is an issue with Leaflet popups in general, we're tracking the upstream issue in #247.) Esri's a11y-map (yes I'm referring to them again! 😋) doesn't have these issues because each feature within the "scope" is:
I think the a11y-map's interaction model is intuitive, it doesn't need to include features in the tab order (unlike regular documents). |
a11y's querying is similar to Google's, and it works well when you have a discrete number of features. In mapml from what I can tell there can be a continuous number of queryable points on the map. There's querying a layer and querying a feature. Querying a layer is continuous but "querying" features is discrete. If you had to use the square model of a11y or google maps you would only show that conditionally as you still have the issue of continuous querying. I guess you could introduce a new crosshair + square hybrid? Where numbers query a feature but space queries the center? |
I'm getting a strange bug where the popup is misplaced when opening it by pressing Enter, only when using a screen reader (NVDA in this case):
|
src/mapml/layers/MapLayer.js
Outdated
@@ -94,7 +94,7 @@ export var MapMLLayer = L.Layer.extend({ | |||
if (properties) { | |||
var c = document.createElement('div'); | |||
c.insertAdjacentHTML('afterbegin', properties.innerHTML); | |||
geometry.bindPopup(c, {autoPan:false}); | |||
geometry.bindPopup(c, {autoPan:false, closeButton: false}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are close buttons not useful in feature's popups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @shepazu mentioned they might be problematic, or it might have been me misinterpreting something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was suggested that it be removed, should it be added back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having a close button is fine, with the following caveats:
- the popup should not be a modal (that is, it shouldn't be a focus trap)
- if possible, we shouldn't force screen reader users to "close" each feature popup to move on to another feature
This seems like somewhat competing experiences between voice-control and screen-reader users, in exposing the right amount of detail with the fewest possible number of forced interactions. My preference would be to have the popup not exposed to screen readers on focus, but only read the accessible name (the popup "title"), with notification of additional information (e.g. aria-expanded
) to access the other popup details only on demand (at which point they might encounter the close button, but that's fine, because they chose to expand it). For voice-control users, I think having the popup on focus should be good, with scrolling for long details, and a close button.
Does this seem right to you, @Malvoz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having a close button is fine, with the following caveats:
- the popup should not be a modal (that is, it shouldn't be a focus trap)
The popups are non-modal, so focus traps are (mostly*) not an issue.
*when the popup for the last feature in the sequence is opened tabbing is currently trapped to some extent (shift + tab can be used to move back to the previous feature):
Keyboard.Interaction.Test.-.Google.Chrome.2021-02-08.11-06-.mp4 |
if possible, we shouldn't force screen reader users to "close" each feature popup to move on to another feature
Because focus (generally) isn't trapped inside popups users don't have to explicitly close popups before moving on to other features/focusable elements.
This seems like somewhat competing experiences between voice-control and screen-reader users, in exposing the right amount of detail with the fewest possible number of forced interactions.
I'm not super familiar with voice-control so I'm not sure about how there are competing experiences here. I do know that some people use voice-control to move their cursor around to interact with elements, in that case I think a close button could be appreciated if they just wanted to close a popup without opening a new one.
My preference would be to have the popup not exposed to screen readers on focus, but only read the accessible name (the popup "title"), with notification of additional information (e.g.
aria-expanded
) to access the other popup details only on demand (at which point they might encounter the close button, but that's fine, because they chose to expand it).
Yes I think we agreed that popups should not be opened (and thus exposed to ATs) when a feature recieves focus, and that each feature itself should be labelled for discernibility. (discussion from #270 (comment))
I agree that features that are interactive and have popups should expose the state of the popup using aria-expanded
.
I think the reticle / graticule could be about 2x as big and bold, personally. I find it easy to not notice. WDYT? |
@Malvoz when I use it I don't even get a popup? I put a breaker on leaflet code responsible for creating the popup and it seems with NVDA running that code is never reached, Certain keyboard events might be getting hijacked? Source http://melmo.github.io/accessibility/code/dist/leaflet.html |
For reference this is what 2x would look like, that's not considering bolding either. It goes from being a map with a UI to being a UI with a map, if that makes sense, but you're right in that it might make seeing it easier. Pros and cons. Currently its 36x36px, maybe making it 44x44px is appropriate so it's the same size as the buttons? |
2021-01-29.09-28-12_Trim.mp4
Allow features to be tab navigable and add crosshair to map when query layer exists + map is tab focused
Closes #268 also closes #260
Edit:
Now adds navigation bypass
2021-02-05.10-39-17.mp4
Closes #280