From 28b1672a33b194dbd230bf806820b0dfaab4ae30 Mon Sep 17 00:00:00 2001 From: Raphael Prasquier Date: Sat, 3 Oct 2026 18:10:28 +0200 Subject: [PATCH] fix(web): switch thumbs stay in their track while scrolling The switch thumb carried `will-change-transform`, which promotes it to its own compositor layer. While scrolling, that layer is composited a frame apart from the rest of the page, so the thumb visibly slides out of its track. The thumb only animates `translate` on toggle, which does not need the hint. Co-Authored-By: Claude Opus 5.5 (1M context) --- apps/web/src/components/ui/menu.tsx | 2 +- apps/web/src/components/ui/switch.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/ui/menu.tsx b/apps/web/src/components/ui/menu.tsx index a8687dcdbc7de..e1e94546742a2 100644 --- a/apps/web/src/components/ui/menu.tsx +++ b/apps/web/src/components/ui/menu.tsx @@ -148,7 +148,7 @@ function MenuCheckboxItem({ className="inset-shadow-[0_1px_--theme(--color-black/4%)] inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(4)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:opacity-64 sm:[--thumb-size:--spacing(3)]" keepMounted > - + ) : ( diff --git a/apps/web/src/components/ui/switch.tsx b/apps/web/src/components/ui/switch.tsx index e6bf20aa64c7e..826f35382dfbe 100644 --- a/apps/web/src/components/ui/switch.tsx +++ b/apps/web/src/components/ui/switch.tsx @@ -35,7 +35,7 @@ function Switch({ >