Procházet zdrojové kódy

fix DecimalField autofocus

Ivan Valkou před 5 roky
rodič
revize
987a1efc96
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  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
     }