-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Current behaviour
When using the Menu component from React Native Paper, a visual glitch occurs:
Whenever the menu is opened dynamically using coordinates (e.g., anchor={{ x, y }}), a semi-transparent duplicate of the menu briefly flashes at the top-left corner of the screen (position (0, 0)) before rendering at the correct anchor position.
This issue happens consistently when opening menus that are positioned using touch event coordinates or dynamic measurement values inside a list (FlatList).
Preview
Screen.Recording.2025-10-31.at.6.33.47.PM.mov
Expected behaviour
The Menu should appear only at the specified anchor position immediately upon opening.
There should be no flicker, flash, or duplicate menu rendered at (0, 0).
Actual behaviour
-
When tapping a menu trigger (IconButton), the menu opens correctly at the desired position.
-
However, just before that, a brief flash of the menu appears at the top-left corner of the screen.
-
The flicker looks like a low-opacity duplicate and disappears within a fraction of a second.
How to reproduce?
- Render a list of items (e.g., with FlatList).
- For each item, display a trigger button to open a Menu.
- Use dynamic touch coordinates or measurements to position the menu
const handleOpenMenu = (e) => { const { pageX, pageY } = e.nativeEvent; setMenuPos({ x: pageX, y: pageY }); setMenuVisible(true); } - Open the menu.
- Observe a quick flash at the top-left corner before the menu displays correctly.
Code Snippet
minimal reproduce example
`<Menu
visible={menuVisible}
onDismiss={() => setMenuVisible(false)}
anchor={{ x: menuPos.x, y: menuPos.y }}
<Menu.Item onPress={() => {}} title="Edit Item" />
<Menu.Item onPress={() => {}} title="Delete Item" />