Skip to content

Build your personal knowledge base with Trilium Notes

feat(widgets): prevent clicks in toggle from dismissing menu

Elian Doranb39a6bcc97cf
diff --git a/apps/client/src/widgets/react/FormList.tsx b/apps/client/src/widgets/react/FormList.tsx
index 3f81472414..95a1052621 100644
--- a/apps/client/src/widgets/react/FormList.tsx
+++ b/apps/client/src/widgets/react/FormList.tsx
@@ -139,8 +139,12 @@ export function FormListToggleableItem({ title, currentValue, onChange, ...props
onChange(newValue: boolean): void;
}) {
return (
- <FormListItem {...props}>
- <FormToggle switchOnName={title} switchOffName={title} currentValue={currentValue} onChange={onChange} />
+ <FormListItem {...props} onClick={(e) => e.stopPropagation()}>
+ <FormToggle
+ switchOnName={title} switchOffName={title}
+ currentValue={currentValue}
+ onChange={onChange}
+ />
</FormListItem>
);
}