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?)

This commit is contained in:
dankito 2020-09-02 16:39:18 +02:00
parent cd365fd0cd
commit d17c91b6d6
1 changed files with 3 additions and 1 deletions

View File

@ -127,7 +127,9 @@ struct UIKitTextField: UIViewRepresentable {
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
if isUserInputEnabled { if isUserInputEnabled {
isFocussedChanged?(true) if textField.isFirstResponder {
isFocussedChanged?(true)
}
} }
return isUserInputEnabled return isUserInputEnabled