Missing accessible name for copy to clipboard button
-
Hello, Ryo (@looswebstudio).
Thanks for your great work on the plugin. I have one suggestion. There is a button “copy to clipboard”, but it’s missing the accessible name. Therefore the screen reader users don’t know the purpose of the action.
Basically, this code:
<button class="hcb-clipboard" data-clipboard-target="[data-hcb-clip="1"]" data-clipboard-action="copy"></button>
should be:
<button class="hcb-clipboard" data-clipboard-target="[data-hcb-clip="1"]" data-clipboard-action="copy"><span class="visually-hidden">Copy to clipboard</span></button>
Where .visually-hidden is the CSS class. Example code: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
The above would improve accessibility.
We have applied changes locally so you can see how it works. Example page with code blocks and copy to clipboard button:
- The topic ‘Missing accessible name for copy to clipboard button’ is closed to new replies.