commit 264a76b2929101ac66fa4e895d6c174cf70300b9
parent 92f6405f6d73a15bdc8e04ee8d2f54dd29511389
Author: Marc Stibane <marc@taler.net>
Date: Sat, 20 Jul 2024 20:42:04 +0200
Must not set controller.frontendState in Send/Request .onAppear, otherwise keyboard will not show
Diffstat:
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/TalerWallet1/Views/Balances/SendRequestV.swift b/TalerWallet1/Views/Balances/SendRequestV.swift
@@ -20,6 +20,7 @@ struct SendRequestV: View {
let cameraAction: () -> Void
@EnvironmentObject private var model: WalletModel
+ @EnvironmentObject private var controller: Controller
@AppStorage("minimalistic") var minimalistic: Bool = false
@State private var buttonSelected: Int? = nil
@@ -84,8 +85,8 @@ struct SendRequestV: View {
fitsSideBySide: false,
lineLimit: 5,
sendDisabled: disableSend,
- sendAction: { selectAndUpdate(1) },
- recvAction: { selectAndUpdate(2) })
+ sendAction: { controller.frontendState = -1; selectAndUpdate(1) },
+ recvAction: { controller.frontendState = 1; selectAndUpdate(2) })
Group {
if #available(iOS 16.0, *) {
ViewThatFits(in: .horizontal) {
diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
@@ -99,7 +99,7 @@ struct RequestPayment: View {
.navigationTitle(navTitle)
.onAppear {
DebugViewC.shared.setViewID(VIEW_P2P_REQUEST, stack: stack.push())
- controller.frontendState = 1 // incoming
+ // if we set >> controller.frontendState = 1 << here, then becomeFirstResponder won't work!
symLog.log("❗️ \(navTitle) onAppear")
}
.onDisappear {
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -137,7 +137,7 @@ struct SendAmount: View {
.navigationTitle(navTitle)
.onAppear {
DebugViewC.shared.setViewID(VIEW_P2P_SEND, stack: stack.push())
- controller.frontendState = -1 // outgoing
+ // if we set >> controller.frontendState = -1 << here, then becomeFirstResponder won't work!
symLog.log("❗️ \(navTitle) onAppear")
}
.onDisappear {