Skip to content

fix: add 'Copied!' feedback to copy-to-clipboard button#10854

Open
mixelburg wants to merge 1 commit into
swagger-api:masterfrom
mixelburg:fix-copy-to-clipboard-feedback
Open

fix: add 'Copied!' feedback to copy-to-clipboard button#10854
mixelburg wants to merge 1 commit into
swagger-api:masterfrom
mixelburg:fix-copy-to-clipboard-feedback

Conversation

@mixelburg
Copy link
Copy Markdown

Fixes #10853

Problem

The copy-to-clipboard button shows no visual feedback after clicking. Users cannot tell whether the text was actually copied, making the experience confusing.

Solution

Added a stateful "Copied!" text that replaces the clipboard icon for 2 seconds after clicking the copy button. The title tooltip also changes from "Copy to clipboard" to "Copied!" during this period.

Changes

  • src/core/components/copy-to-clipboard-btn.jsx: Added copied state, handleCopy callback, timer cleanup on unmount, and conditional rendering showing "Copied!" text
  • src/style/_buttons.scss: Added .copy-to-clipboard__copied style for the feedback text

Previously, the copy-to-clipboard button showed no visual feedback
after clicking, making it unclear whether the text was actually copied.

This change adds a brief "Copied!" text that appears for 2 seconds
after clicking the copy button, replacing the clipboard icon.

Fixes swagger-api#10853
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing Clipboard Icon

1 participant