[Accessibility] Icons: Detected by Narrator in Scan Mode, despite role="presentation"?
Environment Information
- Package version(s): Latest
- Browser and OS versions: Microsoft Edge, Windows 10 Enterprise, Version 1809, OS build 17763.316
Please provide a reproduction of the bug in a codepen:
https://codepen.io/anon/pen/aMbyMW
Actual behavior:
Narrator stops at Icons in Scan Mode, even though they have role="presentation".
According to the Narrator team:
The UIA representation (whether it's about
<i>under the hood or something built around it) claims there is an interactive element. And Narrator stops on that element.
Expected behavior:
Narrator shouldn't stop on Icons in Scan Mode.
Priorities and help requested:
Are you willing to submit a PR to fix? No
Requested priority: Normal; don't think it's a MAS violation
Products/sites affected: Anything that uses Fabric Icons
Hi @HalcyonPride, I can't seem to repro this bug. Can you please provide a screen recording of the bug? Thanks!
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!
@leddie24 said he can repro it now
@micahgodbolt @cschlechty , do you have any recommendations on this issue? I spoke with @betrue-final-final and he said the best approach would be to have alt text attribute similar to an img element, where it would read "Image dog jumping through hoop" if you pass in <img alt="Dog jumping through hoop" />, but in this case, it would read "Icon CompassNW". However, we can't simply pass an alt attribute or title since screen readers aren't aware that the element is an Icon, and simply adding "Icon" to the beginning of an alt attribute or title doesn't work because we have the issue of localization.
Take a look at https://css-tricks.com/can-make-icon-system-accessible/ We likely want to behave similar to calling it a role="img" with an aria-label. If no label is provided, we could hide it.
On Mon, Mar 18, 2019 at 12:38 PM Eddie Liu [email protected] wrote:
@micahgodbolt https://github.com/micahgodbolt @cschlechty https://github.com/cschlechty , do you have any recommendations on this issue? I spoke with @betrue-final-final https://github.com/betrue-final-final and he said the best approach would be to have alt text attribute similar to an img element, where it would read "Image dog jumping through hoop" if you pass in
, but in this case, it would read "Icon CompassNW". However, we can't simply pass an alt attribute or title since screen readers aren't aware that the element is an Icon, and simply adding "Icon" to the beginning of an alt attribute or title doesn't work because we have the issue of localization.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OfficeDev/office-ui-fabric-react/issues/8139#issuecomment-474069771, or mute the thread https://github.com/notifications/unsubscribe-auth/ATa0j6yFi0UYZo0zStQEBLXsOMG1iNIEks5vX-swgaJpZM4bVQGZ .
Firstly need to identify whether icon is meaningful or not. If meaningful then we can add alt="some meaningful text" so that screen reader will be able to read it in both scan/tab mode. but if icon is not meaningful then we can add alt="" by doing this screen reader will ignore it.
Icons are not img, and don't support "alt". If meaningful, it should have and appropriate role and label value. The control consumer will decide if it's significan.
On Mon, Mar 18, 2019 at 4:33 PM awalia13 [email protected] wrote:
Firstly need to identify whether icon is meaningful or not. If meaningful then we can add alt="some meaningful text" so that screen reader will be able to read it in both scan/tab mode. but if icon is not meaningful then we can add alt="" by doing this screen reader will ignore it.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OfficeDev/office-ui-fabric-react/issues/8139#issuecomment-474141302, or mute the thread https://github.com/notifications/unsubscribe-auth/ATa0jw8pdRe4MisGHscWFVkGqHTmjIcnks5vYCJHgaJpZM4bVQGZ .
btw icons can take aria-label no problem, but the role is hard set, so while this does announce properly in scan mode, the role doesn't update https://codepen.io/micahgodbolt/pen/aMjBRW
Also note, that this still doesn't give us a way to skip the icon, just a way to give it something to read.
In most cases icons on their own will be inside of a button next to text. In those cases narrator only reads the button text, not the icon itself.
In cases where there is no label, it might make sense to mark them as hidden to remove them from the UIA tree.
On Mon, Mar 18, 2019 at 4:49 PM Micah Godbolt [email protected] wrote:
btw icons can take aria-label no problem, but the role is hard set, so while this does announce properly in scan mode, the role doesn't update https://codepen.io/micahgodbolt/pen/aMjBRW
Also note, that this still doesn't give us a way to skip the icon, just a way to give it something to read.
In most cases icons on their own will be inside of a button next to text. In those cases narrator only reads the button text, not the icon itself.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OfficeDev/office-ui-fabric-react/issues/8139#issuecomment-474144692, or mute the thread https://github.com/notifications/unsubscribe-auth/ATa0j-U1aAT276Qz9fDOBsHiuioCV5cKks5vYCYJgaJpZM4bVQGZ .
updated with the 2nd icon having 'aria-hidden'. That works great. Should all icons be aria-hidden then? That's the intention right? They are purely decorative.
Agrees with Micah,if they are purely decorative then we can add aria-hidden ="true" so that screen reader will ignore it.
PR is open at #8380 would love some feedback on if this is the correct approach. i.e. Is it better to make aria-hidden optional? Would it default to on or off? Or should icons always be hidden?
Closed via #8820