Update clipboard tooltip to say `Copied` after clicking
What does this MR do and why?
A few improvements to our copy buttons:
- Updates the tooltip to say
Copied
after successfully copying the value - Updates logic to prevent button from losing focus after copying (a11y fix). Due to https://github.com/zenorocha/clipboard.js/issues/695 (closed but still an issue)
- Updates the
clipboard
library to the latest version (needed to make the focus logic work correctly). - Improves parity between Vue and HAML clipboard buttons
Screenshots or screen recordings
Vue clipboard button
Using mouse
Before | After |
---|---|
Screen_Recording_2021-12-02_at_11.09.35_AM | Screen_Recording_2021-12-01_at_1.03.53_PM |
Using screen reader (Safari)
Focus order is no longer lost. Copied
is announced.
Before | After |
---|---|
Screen_Recording_2021-12-02_at_10.51.56_AM | Screen_Recording_2021-12-02_at_10.37.40_AM |
HAML clipboard button
Using mouse
Before | After |
---|---|
Screen_Recording_2021-12-02_at_11.08.00_AM | Screen_Recording_2021-12-02_at_11.06.38_AM |
Using screen reader (Safari)
Focus order is no longer lost. Copied
is announced.
Before | After |
---|---|
Screen_Recording_2021-12-02_at_10.50.41_AM | Screen_Recording_2021-12-02_at_10.39.02_AM |
How to set up and validate locally
Vue clipboard button
- Navigate to a MR and leave a comment in the
Changes
tab. - Navigate back to the
Overview
tab and click the clipboard button
HAML clipboard button
- Navigate to a group
- Click the
Group ID: <id>
button
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Hegman