-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch react-native-paper@5.14.5 for the project I'm working on.
I noticed that the Menu component in expo 54 (RN 0.81) can only be opened once, then it stays closed. This affects both iOS and Android.
For some reason I noticed that the finished flag was always false on the hide callback, I'm unsure why this would be. This patch isn't perfect, it now seems like animations only work the first time, however it at least opens and closes fine.
Video of bug
CleanShot.2025-09-17.at.11.09.55.mp4
Video of patched version (no animations after first, but at least opens)
CleanShot.2025-09-17.at.11.10.20.mp4
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-paper/src/components/Menu/Menu.tsx b/node_modules/react-native-paper/src/components/Menu/Menu.tsx
index 55922c1..9b53403 100644
--- a/node_modules/react-native-paper/src/components/Menu/Menu.tsx
+++ b/node_modules/react-native-paper/src/components/Menu/Menu.tsx
@@ -359,11 +359,9 @@ const Menu = ({
easing: EASING,
useNativeDriver: true,
}),
- ]).start(({ finished }) => {
- if (finished) {
- focusFirstDOMNode(menuRef.current);
- prevRendered.current = true;
- }
+ ]).start(() => {
+ focusFirstDOMNode(menuRef.current);
+ prevRendered.current = true;
});
}, [anchor, attachListeners, measureAnchorLayout, theme]);
@@ -377,13 +375,11 @@ const Menu = ({
duration: ANIMATION_DURATION * animation.scale,
easing: EASING,
useNativeDriver: true,
- }).start(({ finished }) => {
- if (finished) {
- setMenuLayout({ width: 0, height: 0 });
- setRendered(false);
- prevRendered.current = false;
- focusFirstDOMNode(anchorRef.current);
- }
+ }).start(() => {
+ setMenuLayout({ width: 0, height: 0 });
+ setRendered(false);
+ prevRendered.current = false;
+ focusFirstDOMNode(anchorRef.current);
});
}, [removeListeners, theme]);
This issue body was partially generated by patch-package.
faisalamin9696, shoffing, infrateammarlothailand, td-miloszdubiel, icedevml and 20 moreroitium, faisalamin9696, gogupaul123, shoffing, alemar11 and 6 morefarynaio, shoffing, bradstiff, berkcoker, ievolution and 2 more
Metadata
Metadata
Assignees
Labels
No labels