The Dialog with ScrollArea, Title and Actions goes beyond SafeAreaView
See original GitHub issueCurrent 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
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)
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:
- Created 2 years ago
- Reactions:1
- Comments:10
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This one: https://github.com/callstack/react-native-paper/blob/main/example/src/Examples/Dialogs/DialogWithLongText.tsx
https://play.google.com/store/apps/details?id=com.callstack.reactnativepaperexample
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.