Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Prevent accidental clicks on label with boolean control (#3756)

Oleg Isonen0cd5080d7658
diff --git a/apps/builder/app/builder/features/settings-panel/controls/boolean.tsx b/apps/builder/app/builder/features/settings-panel/controls/boolean.tsx
index b706b14eda..0c91d65bf6 100644
--- a/apps/builder/app/builder/features/settings-panel/controls/boolean.tsx
+++ b/apps/builder/app/builder/features/settings-panel/controls/boolean.tsx
@@ -1,5 +1,5 @@
import { useStore } from "@nanostores/react";
-import { Grid, Switch, theme, useId } from "@webstudio-is/design-system";
+import { Grid, Switch, theme } from "@webstudio-is/design-system";
import {
BindingControl,
BindingPopover,
@@ -23,7 +23,6 @@ export const BooleanControl = ({
onChange,
onDelete,
}: ControlProps<"boolean">) => {
- const id = useId();
const label = humanizeString(meta.label || propName);
const { scope, aliases } = useStore($selectedInstanceScope);
const expression =
@@ -44,16 +43,11 @@ export const BooleanControl = ({
align="center"
gap="2"
>
- <Label
- htmlFor={id}
- description={meta.description}
- readOnly={overwritable === false}
- >
+ <Label description={meta.description} readOnly={overwritable === false}>
{label}
</Label>
<BindingControl>
<Switch
- id={id}
disabled={overwritable === false}
checked={Boolean(computedValue ?? false)}
onCheckedChange={(value) => {