From 9aaaf429d9c0817bc19eca1789533c42e159408b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20F=C3=A9lix?= Date: Thu, 18 Apr 2024 08:14:13 +0200 Subject: [PATCH] fix: :bug: lift mode duplicate ids lead to incorrect behavior (#3433) ## Bug: When clicking on the "Lift Mode" Text instead of the toggle itself, since there were multiple `lift-mode` ids before (one for each block), the incorrect toggle would be activated. https://github.com/shadcn-ui/ui/assets/61006057/261ec82f-9274-4e0a-ac21-5e3aa3ceece3 ## Fix: Instead of the id being static I changes the `id`, as well as the `htmlFor` attributes to `lift-mode-${block.name}`. This prevents duplicate ids, as long as there are no two blocks with the same name. --- apps/www/components/block-toolbar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/components/block-toolbar.tsx b/apps/www/components/block-toolbar.tsx index 03bd7484de..13616e739e 100644 --- a/apps/www/components/block-toolbar.tsx +++ b/apps/www/components/block-toolbar.tsx @@ -113,11 +113,11 @@ export function BlockToolbar({ {block.hasLiftMode && ( <>
-