question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The Dialog with ScrollArea, Title and Actions goes beyond SafeAreaView

See original GitHub issue

Current behaviour

The Dialog with ScrollArea, Title and Actions goes beyond SafeAreaView

Expected behaviour

When I use a Dialog with ScrollArea, Title and Actions, it should fit the viewable screen.

Code sample

On Snack.io

import * as React from 'react';
import { SafeAreaView, ScrollView } from 'react-native';
import { Provider, Button, Dialog, Portal, Text } from 'react-native-paper';

const MyComponent = () => {
  const DATA = Array.from(Array(45).keys());

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

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

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

  return (
    <Provider>
      <SafeAreaView>
        <Button mode="contained" onPress={showDialog}>Show Dialog</Button>
        <Portal>
          <Dialog visible={visible} onDismiss={hideDialog}>
            <Dialog.Title>Scroll Dialog</Dialog.Title>
            <Dialog.ScrollArea>
              <ScrollView>
                {DATA.map((d, i) => (<Text key={i} style={{ padding: 10 }}>Item {i}</Text>))}
              </ScrollView>
            </Dialog.ScrollArea>
            <Dialog.Actions>
              <Button onPress={hideDialog}>OK</Button>
            </Dialog.Actions>
          </Dialog>
        </Portal>
      </SafeAreaView>
    </Provider>
  );
};

export default MyComponent;

Screenshots (if applicable)

image

What have you tried

I’ve tried to fix the ScrollArea height but it’s a poor experience for user. I’ve also tried to set a relative maxHeight in percentage, but also a poor experience.

Your Environment

software version
android 11
react-native 0.63
react-native-paper 4.9.2
node 14.17.5
npm 7.20.6
expo sdk 41

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

0reactions
github-actions[bot]commented, Sep 25, 2021

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Dialog with ScrollArea, Title and Actions goes ... - GitHub
The Dialog with ScrollArea, Title and Actions goes beyond SafeAreaView #669. Sign in to view logs · Sign in to view logs ...
Read more >
SafeAreaView - React Native
The purpose of SafeAreaView is to render content within the safe area boundaries of a device. It is currently only applicable to iOS...
Read more >
sitemap-questions-19.xml - Stack Overflow
... com/questions/33174/accessing-sharepoint-from-outside-the-webui 2022-07-24 ... https://stackoverflow.com/questions/233107/is-there-a-name-meaning-not-a- ...
Read more >
libraries_by_dependents.md · SwhGo_oN/SlinkyTyped - Gitee
Number of dependents Library Description 74977 lodash Lodash modular utilities. 44064 chalk Terminal string styling done right 37060 request Simplified HTTP request client.
Read more >
react-native-paper: Versions - Openbase
Full version history for react-native-paper including change logs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found