fix: package manager copy buttons#32228
Merged
Merged
Conversation
Contributor
Review✅ No issues found in commit Code ReviewThis code review is in beta and may not always be helpful — use your judgment. No code review issues found. ConventionsNo convention issues found. Style Guide ReviewNo style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Contributor
|
Nimbus Preview URL: https://028f050e.preview.developers.cloudflare.com |
mvvmm
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clicking a package-manager copy button could make every other copy icon on the page vanish. This fixes it by toggling icons instead of replacing the button's contents.
Why
astro-icon renders the first ph:copy on a page as a shared … and every other instance as . That definition happens to live inside the first copy button.
The click handler swapped the icon with btn.replaceChildren(...). So clicking the button that hosts the definition deleted the , orphaning all 12+ references — every other copy icon disappeared, and didn't come back (the 1.5s "restore" was itself a pointing at the now-missing symbol).
Repro: https://developers.cloudflare.com/workers/framework-guides/automatic-configuration/#deploy-with-automatic-configuration — click one copy button, watch the others go blank.
The fix
Doesn't rely on astro-icon's dedup internals: even a display:none is a valid target, and nothing gets detach
Screenshots (optional)
Documentation checklist