Menu briefly flashes at top-left corner before opening at correct position

Ouverte
#4,827 1 commentaire 8 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

@BogiKay y travaille déjà.

Depuis le 9/3/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

bug
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

https://github.com/user-attachments/assets/7b9f5b7a-fcfe-4947-b622-16afd988dd20

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
  1. When tapping a menu trigger (IconButton), the menu opens correctly at the desired position.

  2. However, just before that, a brief flash of the menu appears at the top-left corner of the screen.

  3. The flicker looks like a low-opacity duplicate and disappears within a fraction of a second.

How to reproduce?
  1. Render a list of items (e.g., with FlatList).
  2. For each item, display a trigger button to open a Menu.
  3. 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); }
  4. Open the menu.
  5. 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" />

`
Langage dominant
TypeScript
Étoiles
14.5k
Forks
2.3k
Merge moyen
8 j 7 h
PR mergées (30 j)
5

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de callstack/react-native-paper

Toutes les issues de callstack/react-native-paper

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.