[A11y] Improve copy button accessibility #8758
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
The Bootstrap 3 popover does not work well with Windows Narrator. Previously, we worked around this by "flashing" the button's pressed state (we set the button's
aria-pressed
totrue
, wait 1.5 seconds, then set it back tofalse
). Now, we work around this by giving the popover a role ofstatus
, which causes Windows Narrator to read the content (Narrator refuses to announce labels with thetooltip
role).Addresses: #8607
Addresses: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1061326
Testing
This change passes Accessibility Insights FastPass:
Windows Narrator
Here is what Windows Narrator announces when you tab to the copy button:
Table, Copy the package manager command, button, off
Table, Copy the package manager command, button
Here is what Windows Narrator announces when you press the copy button:
Copy the package command, button, Copy the package command, button, on
Copied, end of line
NVDA
Here is what NVDA announces when you tab to the copy button:
Copy the package manager command, toggle, button, not pressed
Copy the package manager command, button
Here is what NVDA announces when you press the copy button:
Copied, copied, pressed, not pressed
Copied, copied