Possibly fix menu not close-able

This commit is contained in:
Lim Chee Aun 2023-03-18 22:59:19 +08:00
parent d9b9c04ec0
commit 9d2cc6942c

View file

@ -482,6 +482,7 @@ function RelatedActions({ info, instance, authenticated }) {
}, [info, authenticated]); }, [info, authenticated]);
const loading = relationshipUIState === 'loading'; const loading = relationshipUIState === 'loading';
const menuInstanceRef = useRef(null);
return ( return (
<> <>
@ -521,6 +522,7 @@ function RelatedActions({ info, instance, authenticated }) {
)}{' '} )}{' '}
<span class="buttons"> <span class="buttons">
<Menu <Menu
instanceRef={menuInstanceRef}
portal={{ portal={{
target: document.body, target: document.body,
}} }}
@ -529,6 +531,9 @@ function RelatedActions({ info, instance, authenticated }) {
// Higher than the backdrop // Higher than the backdrop
zIndex: 1001, zIndex: 1001,
}, },
onClick: () => {
menuInstanceRef.current?.closeMenu?.();
},
}} }}
align="center" align="center"
position="anchor" position="anchor"