Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(mobile): workspace selector not close on click outside (#8096)

pengx17989e8830f71c
diff --git a/packages/frontend/component/src/ui/menu/mobile/root.tsx b/packages/frontend/component/src/ui/menu/mobile/root.tsx
index df2b4e32fa..fbe67dfc8e 100644
--- a/packages/frontend/component/src/ui/menu/mobile/root.tsx
+++ b/packages/frontend/component/src/ui/menu/mobile/root.tsx
@@ -19,6 +19,7 @@ export const MobileMenu = ({
contentOptions: {
className,
onPointerDownOutside,
+ onInteractOutside,
// ignore the following props
sideOffset: _sideOffset,
side: _side,
@@ -59,12 +60,13 @@ export const MobileMenu = ({
if (!open) {
// a workaround to hack the onPointerDownOutside event
onPointerDownOutside?.({} as any);
+ onInteractOutside?.({} as any);
setSubMenus([]);
}
setOpen(open);
rootOptions?.onOpenChange?.(open);
},
- [onPointerDownOutside, rootOptions]
+ [onInteractOutside, onPointerDownOutside, rootOptions]
);
const onItemClick = useCallback(