Ivan Valkou 5 лет назад
Родитель
Сommit
987a1efc96
1 измененных файлов с 3 добавлено и 1 удалено
  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)
         textfield.inputAccessoryView = toolBar
         if autofocus {
-            textfield.becomeFirstResponder()
+            DispatchQueue.main.async {
+                textfield.becomeFirstResponder()
+            }
         }
         return textfield
     }