taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit c6c31cbd4afb916cb5247dc84079f7ec9edf2773
parent 6fbad019bfbada93214ce88f3fa1a557d15a1274
Author: Marc Stibane <marc@taler.net>
Date:   Sun, 30 Mar 2025 22:02:17 +0200

hide kbd on OIM

Diffstat:
MTalerWallet1/Views/HelperViews/CurrencyInputView.swift | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/CurrencyInputView.swift b/TalerWallet1/Views/HelperViews/CurrencyInputView.swift @@ -68,7 +68,6 @@ struct CurrencyInputView: View { @EnvironmentObject private var controller: Controller @State private var hasBeenShown = false - @State private var showKeyboard = 0 @State private var useShortcut = 0 @MainActor @@ -167,7 +166,6 @@ struct CurrencyInputView: View { amount = Amount.zero(currency: amount.currencyStr) useShortcut = 0 } - showKeyboard += 1 } if #available(iOS 16.0, *) { let shortcuts = shortcuts(currencyField) @@ -210,12 +208,14 @@ struct CurrencyInputView: View { }.onAppear { // make CurrencyField show the keyboard after 0.4 seconds if hasBeenShown { // print("❗️Yikes: CurrencyInputView hasBeenShown") - } else if !UIAccessibility.isVoiceOverRunning { + } else if !UIAccessibility.isVoiceOverRunning && !controller.oimModeActive { // print("❗️CurrencyInputView❗️") DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) { hasBeenShown = true - if !currencyField.becomeFirstResponder() { - print("❗️Yikes❗️ cannot becomeFirstResponder") + if !controller.oimModeActive { + if !currencyField.becomeFirstResponder() { + print("❗️Yikes❗️ cannot becomeFirstResponder") + } } } } @@ -223,6 +223,9 @@ struct CurrencyInputView: View { currencyField.resignFirstResponder() hasBeenShown = false } + .onChange(of: controller.oimModeActive) {_ in + currencyField.resignFirstResponder() + } } } // MARK: -