Skip to content

Commit c052096

Browse files
authored
fix: change switch on click (#591)
1 parent 2c86281 commit c052096

File tree

1 file changed

+4
-2
lines changed
  • editor/src/editor/layout/inspector/fields

1 file changed

+4
-2
lines changed

editor/src/editor/layout/inspector/fields/switch.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export function EditorInspectorSwitchField(props: IEditorInspectorSwitchFieldPro
1616

1717
return (
1818
<div
19-
onClick={() => {
19+
onClick={(ev) => {
20+
ev.stopPropagation();
21+
2022
setValue(!value);
2123
setInspectorEffectivePropertyValue(props.object, props.property, !value);
2224
props.onChange?.(!value);
@@ -36,7 +38,7 @@ export function EditorInspectorSwitchField(props: IEditorInspectorSwitchFieldPro
3638
<div className="w-full text-ellipsis overflow-hidden whitespace-nowrap">{props.label}</div>
3739

3840
<div className="flex justify-end w-14 py-2">
39-
<Switch checked={value} onChange={() => {}} onClick={(ev) => ev.stopPropagation()} />
41+
<Switch checked={value} onChange={() => {}} />
4042
</div>
4143
</div>
4244
);

0 commit comments

Comments
 (0)