-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Docs: focus handling after Copy to clipboard button pressed #33894
Comments
Focus is not removed manually from the button, the button loses focus because of the bootstrap/site/assets/js/application.js Line 147 in 6ecf218
But this is needed to unselect the code 🙂 There are few issues in the official repo but they are closed without any solution 🤔
/CC @zenorocha PS: This behavior is present on their official website also: https://clipboardjs.com/ |
Thanks for investigating, @rohit2sharma95 ... and yes, turns out that I had actually fixed this originally in clipboard.js zenorocha/clipboard.js#419 |
Is this still applicable @patrickhlauke? |
It is still a problem, but a problem at Clipboard.js' end. Since the original issue over there was summarily closed for no reason, I just reopened a fresh one zenorocha/clipboard.js#805 Wonder if it's worth keeping the issue here open until we see whether there'll be an upstream fix or not. |
My PR on clipboard.js has been merged, so once we grab the most recent release, this issue here will also be addressed zenorocha/clipboard.js#807 |
do we need to actively grab the latest version of clipboard.js, or is this done automagically? |
i see this is now fixed in |
I 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.
The text was updated successfully, but these errors were encountered: