Skip to content

fix: prevent double clipboard alert on copy action#1265

Open
HardeepAsrani wants to merge 6 commits intodevelopmentfrom
fix/issue-530
Open

fix: prevent double clipboard alert on copy action#1265
HardeepAsrani wants to merge 6 commits intodevelopmentfrom
fix/issue-530

Conversation

@HardeepAsrani
Copy link
Member

Summary

render-facade.js could be loaded more than once (registered under multiple handles when charts from different libraries appear on the same page). The copy ClipboardJS instance had no guard against double-initialization, causing the success alert to fire twice.

Added vizClipboard2 guard to mirror the existing vizClipboard1 pattern already used for the shortcode copy button.

Will affect visual aspect of the product

YES/NO

Screenshots

Test instructions

  • Make sure the Copy button doesn't trigger two alert notices.

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/visualizer-pro/issues/530.

render-facade.js could be loaded more than once (registered under
multiple handles when charts from different libraries appear on the
same page). The copy ClipboardJS instance had no guard against
double-initialization, causing the success alert to fire twice.

Added vizClipboard2 guard to mirror the existing vizClipboard1
pattern already used for the shortcode copy button.
@HardeepAsrani HardeepAsrani added the pr-checklist-skip Allow this Pull Request to skip checklist. label Mar 6, 2026
@pirate-bot pirate-bot added pr-checklist-complete The Pull Request checklist is complete. (automatic label) labels Mar 6, 2026
@pirate-bot
Copy link
Contributor

pirate-bot commented Mar 6, 2026

Plugin build for 1cbc093 is ready 🛎️!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants