Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 905a6d0

Browse files
committed
fix copy button on scroll / transitions
1 parent 59c79f6 commit 905a6d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/code/CodeSwitcherSelect.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function CodeSwitcherSelect({
6161
>
6262
<SelectTrigger
6363
aria-label="Switch code language"
64-
className="absolute right-2 top-[2.5px] z-10 hidden h-8 w-28 bg-white/5 text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:flex"
64+
className="absolute right-3.5 top-[2.5px] z-10 hidden h-8 w-28 bg-white/5 text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:flex"
6565
>
6666
<SelectValue />
6767
</SelectTrigger>
@@ -78,7 +78,7 @@ export function CodeSwitcherSelect({
7878
onChange={(e) => setCurrentLanguage(e.target.value as LanguageId)}
7979
className={cn(
8080
'flex h-8 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
81-
'absolute right-2 top-[2.5px] z-10 w-24 bg-white/5 font-sans text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:hidden',
81+
'absolute right-3.5 top-[2.5px] z-10 w-24 bg-white/5 font-sans text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:hidden',
8282
)}
8383
value={selectedLang}
8484
>

src/components/code/CopyButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function CopyButton({
2828
<button
2929
type="button"
3030
className={cn(
31-
'group/button absolute right-2 top-2.5 h-8 rounded-md px-1.5 py-1 text-2xs font-medium backdrop-blur transition',
31+
'group/button absolute right-3.5 top-2.5 z-10 h-8 rounded-md px-1.5 py-1 text-2xs font-medium backdrop-blur transition',
3232
copied
3333
? 'bg-primary-400/10 ring-primary-400/20'
3434
: 'bg-white/5 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5',

0 commit comments

Comments
 (0)