Skip to content

Dialog: at the largest text sizes the dialog grows past the screen and its actions overflow #5297

Open

Description

@Doberjohn

Current behaviour

At the largest iOS text sizes (the accessibility sizes):

  • A Dialog without scrollable whose content grows with the text is taller than the screen and stays centered, so its title starts above the top edge and its actions are off screen and out of the accessibility tree. The content doesn't scroll, so the actions can't be reached. Only a tap on the narrow strips beside the dialog closes it, and a dialog without onDismiss can't be closed at all.
  • The actions row stays a single row aligned to the end, so when two actions don't fit side by side the first one is drawn outside the dialog's start edge, over the scrim, and cut off by the screen.

Android at font scale 2.0 fits. 6.0.0-alpha.3 does the same. A scrollable dialog also needs a style.maxHeight to stay within the screen.

Expected behaviour

The dialog stays within the safe area and its content scrolls, so the title and the actions stay reachable, and actions that don't fit side by side stack, as Material 3 dialogs do. Failing that, the docs say to use scrollable with a maximum height for content that grows with the text size.

How to reproduce?

  1. Set the iOS text size to the largest accessibility size (xcrun simctl ui <device> content_size accessibility-extra-extra-extra-large).
  2. Open a Dialog with an icon, a title, a paragraph of content and two actions:
<Dialog
  visible={visible}
  onDismiss={hide}
  icon="alert"
  title="Dialog with icon"
  content={<Text>A paragraph or two of text explaining the choice.</Text>}
  actions={[
    <Button key="no" mode="text" onPress={hide}>
      Disagree
    </Button>,
    <Button key="yes" mode="text" onPress={hide}>
      Agree
    </Button>,
  ]}
/>
  1. Look at where the title and the actions are, and try to reach the actions.

Related: #2863 (closed).

Your Environment

software version
ios 27.2 (simulator)
react-native 0.88.1 (New Architecture)
react-native-paper 6.0.0-alpha.4 (main at 7ab2640)
expo sdk 58
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