Pārlūkot izejas kodu

fix DecimalField autofocus

Ivan Valkou 5 gadi atpakaļ
vecāks
revīzija
987a1efc96
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      FreeAPS/Sources/Views/DecimalTextField.swift

+ 3 - 1
FreeAPS/Sources/Views/DecimalTextField.swift

@@ -55,7 +55,9 @@ struct DecimalTextField: UIViewRepresentable {
         toolBar.setItems([clearButton, space, doneButton], animated: true)
         toolBar.setItems([clearButton, space, doneButton], animated: true)
         textfield.inputAccessoryView = toolBar
         textfield.inputAccessoryView = toolBar
         if autofocus {
         if autofocus {
-            textfield.becomeFirstResponder()
+            DispatchQueue.main.async {
+                textfield.becomeFirstResponder()
+            }
         }
         }
         return textfield
         return textfield
     }
     }