Skip to content

Menu: on web in right-to-left layouts the menu opens on the far side of the screen from its anchor #5286

Open

Description

@Doberjohn

Current behaviour

On web, when the layout is right to left (PaperProvider direction="rtl" with <html dir="rtl">, or a LocaleProvider direction="rtl" subtree), a Menu opens at the opposite edge of the screen from its anchor. In a 1280px window with the anchor at the right edge (x 1133 to 1263), the menu opens at the left edge (x 16 to 176), with an inline right: 1104px. In left to right it opens over its anchor.

Menu.tsx sets right to the anchor's left-based x when the direction is rtl. On Android and iOS with the app in right to left, React Native swaps left and right, so the value lands correctly; React Native Web keeps right physical, so the position is mirrored a second time. By the same code, a LocaleProvider subtree on Android and iOS, where the app itself is left to right, is likely mirrored too (not checked).

6.0.0-alpha.3 does the same with <html dir="rtl">; since #5255 it also happens inside a LocaleProvider subtree on web.

Expected behaviour

In right to left the menu opens at its anchor, its right edge on the anchor's right edge.

How to reproduce?

  1. Inside PaperProvider, render:
<LocaleProvider direction="rtl">
  <View style={{ alignItems: 'flex-start' }}>
    <Menu
      visible={visible}
      onDismiss={() => setVisible(false)}
      anchor={<Button mode="outlined" onPress={() => setVisible(true)}>Open app menu</Button>}
    >
      <Menu.Item title="Copy" leadingIcon="content-copy" onPress={() => setVisible(false)} />
      <Menu.Item title="Share" leadingIcon="share-variant" onPress={() => setVisible(false)} />
    </Menu>
  </View>
</LocaleProvider>
  1. Export for the web (npx expo export --platform web), open it 1280px wide and press "Open app menu".
  2. The same happens with PaperProvider direction="rtl" and <html dir="rtl">, as the RTL guide describes for the web.

Your Environment

software version
web Chromium 157, Chrome 153
react-native 0.88.1
react-native-web 0.21.4
react-native-paper 6.0.0-alpha.4
expo sdk 58

Activity

  1. added this to the 6.0.0 milestone on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions