mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix(mobile): workspace selector not close on click outside (#8096)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user