Explorar o código

fix DecimalField autofocus

Ivan Valkou %!s(int64=5) %!d(string=hai) anos
pai
achega
987a1efc96
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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
     }