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

This commit is contained in:
pengx17
2024-09-04 16:57:57 +00:00
parent 0ae5673aaa
commit 989e8830f7

View File

@@ -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(