Docs: focus handling after Copy to clipboard button pressed
See original GitHub issueI thought we addressed this ages ago, but: setting keyboard focus on one of the “Copy” buttons and activating it, focus is then lost/reset to the start of the page. While browsers try to error-correct for this (meaning that a subsequent Tab
moves to the next focusable element), the issue becomes evident when using AT (e.g. Chrome/JAWS, activate the button, then use reading keys to carry on reading…focus was moved back right to the start of the page).
Ideally, focus should remain on the “Copy” button, but I’m assuming this was not done in order to “clear” the visual style of the button. Perhaps this needs to dynamically set a class immediately after a copy operation was carried out, which suppresses/changes the styling (maybe suppressing the tooltip, OR adding some indicator like a tick that shows it was indeed copied), and clearing that class again as soon as the button loses focus.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
My PR on clipboard.js has been merged, so once we grab the most recent release, this issue here will also be addressed https://github.com/zenorocha/clipboard.js/pull/807
Thanks for investigating, @rohit2sharma95 … and yes, turns out that I had actually fixed this originally in clipboard.js https://github.com/zenorocha/clipboard.js/pull/419