[Android] Menu flashes when opening
Current behaviour
The menu component flashes when opening the menu via visible=true. I think this is actually not observable in production builds (with a Samsung S21) but rather in poor performance scenarios (dev, emulator)
Expected behaviour
The menu doesnt flash
How to reproduce?
show a menu
Preview
the video only shows the menu flashing once; in the actual emulator it flashes every time when the menu opens
https://github.com/user-attachments/assets/37fa7177-a05e-4a21-bdac-718822acc5bd
What have you tried so far?
await new Promise(resolve => setTimeout(resolve, 1));
fixes this issue; unfortunately I learned enough from experience to know this works but cant tell why.
Your Environment
| software | version |
|---|---|
| ios | n/a |
| android | 36 |
| react-native | 0.81.4 |
| react-native-paper | 5.14.5 |
| node | 22 |
| npm or yarn | yarn v4 |
| expo sdk | 54 |
Same issue. I can't even open the menu again
Same issue. I can't even open the menu again
Did you find a solution? I also experience this issues. 1st tap it will open the menu but 2nd tap it will not show again.
what ur asking for is already an issue https://github.com/callstack/react-native-paper/issues/4807
ill copy what my reply over there here
i'd start logging rendered, visible and prevRendered.current.
if ur setting the menu's visible via ondismiss, check out #4813
for the opening animation checkout #4812
To be honest, this is a different issue @lovegaoshi. I am experiencing the flash during the opening of the menus, not the problems described in the issue you linked. And none of the solutions listed in your links work for me.
Anyone else having this issue? It's pretty bad as a user experience.
I think the current Menu component is not working very much as expected, especially since the upgrade to newer versions of react-native / expo, fixes and suggestions from the maintainers are very unlikely to come out anytime soon, based on #4802. Consider other components such as Dialog or use other libraries such as BottomSheet or Drawer to workaround for the time-being. Or else #4807 is the best solution we have so far that resolves the issue