Fix notifications popover not close-able on iPad

This commit is contained in:
Lim Chee Aun 2024-08-04 13:53:06 +08:00
parent f05e3012e3
commit ad7193d067

View file

@ -152,8 +152,11 @@ function NotificationsMenu({ anchorRef, state, onClose }) {
if (state === 'open') loadNotifications(); if (state === 'open') loadNotifications();
}, [state]); }, [state]);
const menuRef = useRef();
return ( return (
<ControlledMenu <ControlledMenu
ref={menuRef}
menuClassName="notifications-menu" menuClassName="notifications-menu"
state={state} state={state}
anchorRef={anchorRef} anchorRef={anchorRef}
@ -161,6 +164,11 @@ function NotificationsMenu({ anchorRef, state, onClose }) {
portal={{ portal={{
target: document.body, target: document.body,
}} }}
containerProps={{
onClick: () => {
menuRef.current?.closeMenu?.();
},
}}
overflow="auto" overflow="auto"
viewScroll="close" viewScroll="close"
position="anchor" position="anchor"