Skip to content

Components: add reset timeout to ColorPicker's copy functionality #34289

@ciampo

Description

@ciampo

Part of #34284

Why

The recently added g2 ColorPicker has a minor UX issue when copying the color value to the clipboard (first reported in #33714 (comment)):

  1. User clicks on the color, value is copied in the clipboard. The tooltip changes from "Copy" to "Copied!"
  2. User interacts with other parts of the UI, maybe copies another string of text
  3. User remembers that they need the color value, and so they hover over the color string again. But the tooltip keeps saying "Copied!", instead of "Copy"

What

To solve this issue, we could simply introduce a timer which resets the UI and shows again the "copy" button after a certain amount of time has passed (e.g. 3 seconds)

A/C

  • The UI of the "Copy" button resets (allowing the user to click the button again) after 3 seconds from the previous button click/press
  • The "Copy!" button keeps copying the value to the clipboard as before

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions