Skip to content

fix(docs): handle copy tooltip clicks - #1935

Open
ZLlele wants to merge 1 commit into
animate-css:mainfrom
ZLlele:fix/issue-1928-copy-tooltip
Open

ZLlele wants to merge 1 commit into
animate-css:mainfrom
ZLlele:fix/issue-1928-copy-tooltip

Conversation

@ZLlele

@ZLlele ZLlele commented Oct 27, 2026

Copy link
Copy Markdown

Fixes #1928

Summary

Fix copy-button interactions in the animation list.

Changes

  • Use e.target.closest('.copy-icon') in docs/modules/playground.mjs so clicking the tooltip can still resolve the corresponding copy button and copy the animation class.
  • Scope the tooltip lookup in docs/main.mjs to the current copy button with icon.querySelector('.tooltip').

Why not use pointer-events: none?

The first suggested fix disables pointer events on .tooltip. This was not used because the tooltip overlaps the animation title area. Clicking the left side of the tooltip can then pass through to the animation title and trigger the animation.

Using closest('.copy-icon') keeps tooltip clicks associated with the copy button without relying on pointer-event pass-through.

Validation

  • Verified that only docs/modules/playground.mjs and docs/main.mjs were modified.
  • Passed JavaScript syntax checks with node --check.
  • Passed git diff --check.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

This branch has not been deployed

No deployments
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.

clicking copy button tooltip fails to copy animation class and gives false "Copied!" confirmation

2 participants