Skip to content

Commit 9ac591f

Browse files
samejrclaude
andcommitted
fix(webapp): stop CopyButton nesting a button inside its tooltip trigger
The button variant rendered a real <button> inside the tooltip trigger's own <button>. The browser parser splits nested buttons apart, so React failed to hydrate any page showing one. The trigger now adopts the button itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent e09b00e commit 9ac591f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/webapp/app/components/primitives/CopyButton.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export function CopyButton({
9999
content={copied ? "Copied!" : "Copy"}
100100
className="font-sans"
101101
disableHoverableContent
102+
// The button variant is a real <button>; without asChild the tooltip
103+
// trigger wraps it in its own, and the browser parser splits the nested
104+
// buttons apart, which React then fails to hydrate.
105+
asChild={variant === "button"}
106+
tabbable={variant === "button"}
102107
/>
103108
</span>
104109
);

0 commit comments

Comments
 (0)