diff --git a/apps/client/src/widgets/note_bars/CollectionProperties.tsx b/apps/client/src/widgets/note_bars/CollectionProperties.tsx index 830ef67c2..bee74b513 100644 --- a/apps/client/src/widgets/note_bars/CollectionProperties.tsx +++ b/apps/client/src/widgets/note_bars/CollectionProperties.tsx @@ -106,9 +106,17 @@ function ButtonPropertyView({ note, property }: { note: FNote, property: ButtonP function SplitButtonPropertyView({ note, property }: { note: FNote, property: SplitButtonProperty }) { const parentComponent = useContext(ParentComponent); const ItemsComponent = property.items; + const clickContext = parentComponent && { + note, + triggerCommand: parentComponent.triggerCommand.bind(parentComponent) + }; return (parentComponent && - + clickContext && property.onClick(clickContext)} + > ); diff --git a/apps/client/src/widgets/react/FormList.tsx b/apps/client/src/widgets/react/FormList.tsx index dd5948cb3..42f43a044 100644 --- a/apps/client/src/widgets/react/FormList.tsx +++ b/apps/client/src/widgets/react/FormList.tsx @@ -206,10 +206,11 @@ export function FormDropdownDivider() { return
; } -export function FormDropdownSubmenu({ icon, title, children, dropStart }: { +export function FormDropdownSubmenu({ icon, title, children, dropStart, onDropdownToggleClicked }: { icon: string, title: ComponentChildren, children: ComponentChildren, + onDropdownToggleClicked?: () => void, dropStart?: boolean }) { const [ openOnMobile, setOpenOnMobile ] = useState(false); @@ -224,6 +225,10 @@ export function FormDropdownSubmenu({ icon, title, children, dropStart }: { if (isMobile()) { setOpenOnMobile(!openOnMobile); } + + if (onDropdownToggleClicked) { + onDropdownToggleClicked(); + } }} > {" "}