Skip to content

Update clipboard tooltip to say `Copied` after clicking

What does this MR do and why?

A few improvements to our copy buttons:

  1. Updates the tooltip to say Copied after successfully copying the value
  2. 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)
  3. Updates the clipboard library to the latest version (needed to make the focus logic work correctly).
  4. 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

  1. Navigate to a MR and leave a comment in the Changes tab.
  2. Navigate back to the Overview tab and click the clipboard button

HAML clipboard button

  1. Navigate to a group
  2. 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.

Edited by Peter Hegman

Merge request reports

Loading