Skip to content

Commit e91b01d

Browse files
Kévin Commailletasn
authored andcommitted
Make ConfirmationDialog scrollable in case content is too long
1 parent d2689da commit e91b01d

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

src/widgets/ConfirmationDialog.tsx

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: GPL-3.0-only
33

44
import * as React from "react";
5-
import { Keyboard, Platform } from "react-native";
5+
import { Keyboard, Platform, ScrollView } from "react-native";
66
import { Card, Portal, Modal, Button, ProgressBar, Paragraph, useTheme, Dialog } from "react-native-paper";
77

88
import { isPromise, useIsMounted } from "../helpers";
@@ -89,16 +89,19 @@ export default React.memo(function ConfirmationDialog(props: PropsType) {
8989
visible={props.visible}
9090
onDismiss={props.onCancel}
9191
dismissable={props.dismissable && !loading}
92+
style={{ maxHeight: "100%" }}
9293
>
93-
<Dialog.Title>
94-
{props.title}
95-
</Dialog.Title>
96-
<Dialog.Content>
97-
{content}
98-
</Dialog.Content>
99-
<Dialog.Actions>
100-
{buttons}
101-
</Dialog.Actions>
94+
<ScrollView>
95+
<Dialog.Title>
96+
{props.title}
97+
</Dialog.Title>
98+
<Dialog.Content>
99+
{content}
100+
</Dialog.Content>
101+
<Dialog.Actions>
102+
{buttons}
103+
</Dialog.Actions>
104+
</ScrollView>
102105
</Dialog>
103106
</FakePortal>
104107
);
@@ -110,16 +113,19 @@ export default React.memo(function ConfirmationDialog(props: PropsType) {
110113
visible={props.visible}
111114
onDismiss={props.onCancel}
112115
dismissable={props.dismissable && !loading}
116+
style={{ maxHeight: "100%" }}
113117
>
114-
<Card accessible={false}>
115-
<Card.Title title={props.title} />
116-
<Card.Content>
117-
{content}
118-
</Card.Content>
119-
<Card.Actions style={{ justifyContent: "flex-end" }}>
120-
{buttons}
121-
</Card.Actions>
122-
</Card>
118+
<ScrollView>
119+
<Card accessible={false}>
120+
<Card.Title title={props.title} />
121+
<Card.Content>
122+
{content}
123+
</Card.Content>
124+
<Card.Actions style={{ justifyContent: "flex-end" }}>
125+
{buttons}
126+
</Card.Actions>
127+
</Card>
128+
</ScrollView>
123129
</Modal>
124130
</FakePortal>
125131
);

0 commit comments

Comments
 (0)