From 50353ce6332b0fe637b59b09597ae2fe7c928ab9 Mon Sep 17 00:00:00 2001 From: ErfanBagheri404 Date: Sat, 15 Aug 2026 12:01:59 +0330 Subject: [PATCH 1/2] fix: allow Menu to reopen when hide animation callback never fires On React Native >= 0.80 the hide animation completion callback is not delivered, so prevRendered.current stayed true and the menu could never be shown again after being dismissed. Reset prevRendered.current before starting the hide animation instead of in its completion callback. Fixes #4763 --- src/components/Menu/Menu.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index ca6e849e3d..170713aa40 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -371,6 +371,12 @@ const Menu = ({ const { animation } = theme; + // Reset before the animation starts so that the menu can be re-opened + // even if the hide animation's completion callback never fires (e.g. on + // React Native >= 0.80 where the animation `finished` event is not + // delivered). Without this the menu stays closed and cannot be shown again. + prevRendered.current = false; + Animated.timing(opacityAnimationRef.current, { toValue: 0, duration: ANIMATION_DURATION * animation.scale, @@ -379,7 +385,6 @@ const Menu = ({ }).start(() => { setMenuLayout({ width: 0, height: 0 }); setRendered(false); - prevRendered.current = false; focusFirstDOMNode(anchorRef.current); }); }, [removeListeners, theme]); From 23730357a3d7b3da4b943facaa54e9f47bc5da17 Mon Sep 17 00:00:00 2001 From: ErfanBagheri404 Date: Thu, 20 Aug 2026 21:42:59 +0330 Subject: [PATCH 2/2] fix: guard opening callback with finished flag to prevent race When the menu closes mid-opening animation, the interrupted callback was setting prevRendered.current = true, blocking the next open. Only set it when the animation finishes. Addresses review comment on #5051. --- src/components/Menu/Menu.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index 170713aa40..1f8fb89d58 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -359,9 +359,11 @@ const Menu = ({ easing: EASING, useNativeDriver: true, }), - ]).start(() => { - focusFirstDOMNode(menuRef.current); - prevRendered.current = true; + ]).start(({ finished }) => { + if (finished) { + focusFirstDOMNode(menuRef.current); + prevRendered.current = true; + } }); }); }, [anchor, attachListeners, measureAnchorLayout, theme]);