Fix issue where keyboard covers custom zap comment

Changelog-Fixed: Fix issue where keyboard covers custom zap comment
This commit is contained in:
William Casarin
2023-02-27 11:03:09 -08:00
parent 1288732e5d
commit 2f90f2d4b7

View File

@@ -150,11 +150,13 @@ struct CustomizeZapView: View {
.ignoresSafeArea() .ignoresSafeArea()
} }
var MainContent: some View { var TheForm: some View {
VStack(alignment: .leading) {
Form { Form {
Group {
Section(content: { Section(content: {
AmountPicker AmountPicker
.frame(height: 120)
}, header: { }, header: {
Text("Zap Amount in sats", comment: "Header text to indicate that the picker below it is to choose a pre-defined amount of sats to zap.") Text("Zap Amount in sats", comment: "Header text to indicate that the picker below it is to choose a pre-defined amount of sats to zap.")
}) })
@@ -172,14 +174,12 @@ struct CustomizeZapView: View {
}, header: { }, header: {
Text("Custom Zap Amount", comment: "Header text to indicate that the text field below it is to enter a custom zap amount.") Text("Custom Zap Amount", comment: "Header text to indicate that the text field below it is to enter a custom zap amount.")
}) })
.dismissKeyboardOnTap()
Section(content: { Section(content: {
TextField(NSLocalizedString("Awesome post!", comment: "Placeholder text for a comment to send as part of a zap to the user."), text: $comment) TextField(NSLocalizedString("Awesome post!", comment: "Placeholder text for a comment to send as part of a zap to the user."), text: $comment)
}, header: { }, header: {
Text("Comment", comment: "Header text to indicate that the text field below it is a comment that will be used to send as part of a zap to the user.") Text("Comment", comment: "Header text to indicate that the text field below it is a comment that will be used to send as part of a zap to the user.")
}) })
.dismissKeyboardOnTap()
Section(content: { Section(content: {
ZapTypePicker ZapTypePicker
@@ -187,6 +187,9 @@ struct CustomizeZapView: View {
Text("Zap Type", comment: "Header text to indicate that the picker below it is to choose the type of zap to send.") Text("Zap Type", comment: "Header text to indicate that the picker below it is to choose the type of zap to send.")
}) })
}
.dismissKeyboardOnTap()
if zapping { if zapping {
Text("Zapping...", comment: "Text to indicate that the app is in the process of sending a zap.") Text("Zapping...", comment: "Text to indicate that the app is in the process of sending a zap.")
} else { } else {
@@ -202,8 +205,12 @@ struct CustomizeZapView: View {
Text(error) Text(error)
.foregroundColor(.red) .foregroundColor(.red)
} }
} }
} }
var MainContent: some View {
TheForm
} }
} }