-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Accessibility] SVG images inside buttons need have role="presentation" #3825
Comments
I don't believe I've seen or experienced title as being required for (particularly) what the AT reads out loud. The visual pop up via the title attribute is currently attributed to the button (container of the svg), which also has the role specified. The svg itself does not have a title or label. If, for example, there's an image that is directly related to the content of the article/app/site, then an alt text would be required in order to describe what is being visually presented, but that doesn't apply to this situation.
In regards to AT violations:
In regards to visual violations:
|
Closing due to inactivity. Feel free to respond and we can reopen. |
Apologies for the late response. The issue is flagged in Firefox Developer edition as "Content with images must be labelled". I guess at a simple level, an |
@v-rampul Could one of your team members please check the behavior of the buttons in the sandbox? The link is here: https://webchat-playground.azurewebsites.net/ When using NVDA on Chrome, AT Reads, 'Send button'. If I add alt text ('airplane') to the If anything, it makes more sense to me to add [edit] Behavior I see when testing accessibility in Chrome: Alternatively, should we just add |
@corinagum: We have verified below issue and screen readers are reading the ‘Send button’ and no need to add any Alt text and as verified in Microsoft teams send button, the screen readers are reading only ‘Send button’. |
Since we can all agree the description of the SVG would not be beneficial to AT users, would an agreeable solution be to make the SVG appear via CSS, so that the requirement to give the SVG a |
I see this item as a no-op. The documentation I've been able to find on the accessibility of In this instance, the @compulim could you weigh in? Op or no-op? @WillPS1989, if this is a hard requirement for you, I recommend adding the [Edit] I forgot to mention; we will not be moving SVGs as background images to CSS, which would make the component less customizable for our users. |
This is the DOM of today, much simplified: <button title="Send">
<svg>
<path>...</path>
</svg>
</button> Let's put it aside first and say, if it is an image instead of SVG, it will appears like this: <button title="Send">
<img />
</button> I think it is fair to say: although the image is inside That means, either one of the following will work: <button title="Send"><img alt="" /></button> Or <button title="Send"><img role="presentation" /></button> Or <button title="Send"><img aria-hidden="true" /></button> Putting similar rationale into SVG, I would say one of the following change should be adequate: <button title="Send">
<svg>
<title />
<path>...</path>
</svg>
</button> Or <button title="Send">
<svg role="presentation">
...
</svg>
</button> Or <button title="Send">
<svg aria-hidden="true">
...
</svg>
</button> FYI, making the SVG as a CSS Any thoughts? Additional context
|
[Edit by @corinagum]
Work item: add
role="presentation"
to all SVGs that are inside an input. (Microphone button, attachment button, send button, etc.)Version: latest
Actual result:
The button title is read by the screen reader (e,g, "button send").
Expected result:
The image displayed on the button should also be described, so that the user knows what is being portrayed. This is being flagged by our testing as non-compliant with WCAG2.1
An example of the expected description would be:
<svg title='An image of a paper plane'
Repro Steps:
Open the web chat.
Launch screen reader (e.g, MS Windows Narrator)
Start the conversation.
Navigate to the send or attach button
The text was updated successfully, but these errors were encountered: