From d17c91b6d64053e3478bc41691f97c5a9ca5cc72 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 2 Sep 2020 16:39:18 +0200 Subject: [PATCH] Fixed that isFocussedChanged() got called even though TextField hasn't been focused (but why did textFieldShouldBeginEditing() get called even though it hasn't been focused?) --- ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift index 03c3d5ac..06a0d024 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift @@ -127,7 +127,9 @@ struct UIKitTextField: UIViewRepresentable { func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { if isUserInputEnabled { - isFocussedChanged?(true) + if textField.isFirstResponder { + isFocussedChanged?(true) + } } return isUserInputEnabled