Skip to content

Dialogs are broken with React Native 0.85.2 #4905

@sandeepsengupta

Description

@sandeepsengupta

Current behaviour

When this library is used with React Native 0.85.2, dialogs have a broken visual appearance (in both Android and iOS). The dialog appears at the bottom of the screen, and the darkened background only fills part of the screen:

Image

Expected behaviour

The expected behavior occurs with React Native 0.84.1:

Image

How to reproduce?

  1. Create a new React Native project: npx @react-native-community/cli@latest init DialogBugReproducer
  2. Enter the new project directory: cd DialogBugReproducer
  3. Install react-native-paper: npm install react-native-paper
  4. If you want to reproduce the bug in iOS as well as Android, run cd ios, pod install, and cd ..
  5. Delete all content in App.tsx and replace it with the following code. (This code is copied from the React Native Paper docs, except I have renamed MyComponent to App and added a marginTop to the button to prevent it from displaying underneath the status bar.)
// Code is from https://oss.callstack.com/react-native-paper/docs/components/Dialog/#usage
// with minor changes described above.

import * as React from 'react';
import { View } from 'react-native';
import { Button, Dialog, Portal, PaperProvider, Text } from 'react-native-paper';

const App = () => {
  const [visible, setVisible] = React.useState(false);

  const showDialog = () => setVisible(true);

  const hideDialog = () => setVisible(false);

  return (
    <PaperProvider>
      <View>
        <Button style={{marginTop: 100}} onPress={showDialog}>Show Dialog</Button>
        <Portal>
          <Dialog visible={visible} onDismiss={hideDialog}>
            <Dialog.Title>Alert</Dialog.Title>
            <Dialog.Content>
              <Text variant="bodyMedium">This is simple dialog</Text>
            </Dialog.Content>
            <Dialog.Actions>
              <Button onPress={hideDialog}>Done</Button>
            </Dialog.Actions>
          </Dialog>
        </Portal>
      </View>
    </PaperProvider>
  );
};

export default App;
  1. Run the app in Android or iOS
  2. Click the "Show Dialog" button in the app

What have you tried so far?

I tried downgrading to React Native Paper 5.15.0, but that did not fix the issue.

Your Environment

software version
ios 26.2 (simulated)
android 16 (API 36.1, emulated)
react-native 0.85.2
react-native-paper 5.15.1 and 5.15.0
node 25.9.0
npm or yarn 11.12.1
expo sdk Not using Expo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions