From 0bfeddeea3f6da5c6b4f6f310071923df6a88647 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 4 Oct 2020 22:59:04 +0200 Subject: [PATCH] Fixed that iOS 14 creates text field often twice, but displays it once -> to focus next text field we have to use nextViewTag + 1 --- ui/BankingiOSApp/BankingiOSApp/ui/UIKit/UIKitTextField.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/UIKitTextField.swift b/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/UIKitTextField.swift index a941b8cd..77c4c57d 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/UIKitTextField.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/UIKitTextField.swift @@ -210,7 +210,9 @@ struct UIKitTextField: UIViewRepresentable { let nextView = textField.superview?.superview?.superview?.viewWithTag(nextViewTag) ?? textField.superview?.superview?.superview?.superview?.superview?.viewWithTag(nextViewTag) // for text fields in Lists (tables) - + ?? textField.superview?.superview?.superview?.viewWithTag(nextViewTag + 1) // iOS 14 often creates the same TextField twice but displays it once -> to select next view use nextViewTag + 1 + ?? textField.superview?.superview?.superview?.superview?.superview?.viewWithTag(nextViewTag + 1) + didHandleReturnKey = nextView?.focus() ?? false }