Skip to content

[BUG] Copy button remains in "Copied!" state after page refresh #37361

Description

@vidhimeshram

🐛 What's broken?

The Copy button in the Animation Builder remains in the "Copied!" state even after refreshing the page. The copied status should be reset when the page reloads.


📋 Steps to Reproduce

  1. Open the Animation Builder page.
  2. Generate or copy the animation class string.
  3. Click the Copy button.
  4. Verify that the button text changes to "Copied!".
  5. Refresh the page.

✅ Expected Behavior

After a page refresh, the button should return to its default state (e.g., "Copy"), since the copied action is only relevant to the current session.

❌ Actual Behavior

The button still displays "Copied!" after the page reloads, giving the impression that the copy action has just occurred.


🔗 Reproduction

Copy

//js
copyBtn.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(generatedCodeEl.textContent);

copyBtn.textContent = "Copied!";

setTimeout(() => {
  copyBtn.textContent = "Copy";
}, 1500);

} catch (error) {
console.error("Failed to copy:", error);
}
});

🌍 Environment

OS: Windows 11
Browser: Google Chrome
Issue observed on the Animation Builder page


📸 Screenshot (optional)

Image

Note: Please do not open bug reports for contributions or feature ideas. Use the Feature Request template for those. If you have questions or need help, join our official Discord Server.

Metadata

Metadata

Labels

ECSoC26GSSoC-26Official GSSoC 2026 issueacceptedContribution approved for integration into EaseMotion CSSanimationAnimation effects, hover interactions, motion ideas, transitionsbugSomething isn't workinggood first issueGood for newcomersgssoc:approvedApproved for GSSoC contributionshelp wantedExtra attention neededlevel:intermediateRequires moderate project understanding

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions