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