diff --git a/ios/ConArtist/Components/FancyTextField.swift b/ios/ConArtist/Components/FancyTextField.swift index da7e88d9..1aba77ac 100644 --- a/ios/ConArtist/Components/FancyTextField.swift +++ b/ios/ConArtist/Components/FancyTextField.swift @@ -59,7 +59,6 @@ class FancyTextField: UITextField { formattedLabel.textColor = textColor formattedLabel.textAlignment = textAlignment - // TODO: should this be done with autolayout instead? underlineView.leftAnchor.constraint(equalTo: leftAnchor, constant: 10).isActive = true underlineView.rightAnchor.constraint(equalTo: rightAnchor, constant: -10).isActive = true underlineView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true diff --git a/ios/ConArtist/Scenes/New Sale/ProductTypeListViewController.swift b/ios/ConArtist/Scenes/New Sale/ProductTypeListViewController.swift index a5120703..a2206042 100644 --- a/ios/ConArtist/Scenes/New Sale/ProductTypeListViewController.swift +++ b/ios/ConArtist/Scenes/New Sale/ProductTypeListViewController.swift @@ -45,10 +45,15 @@ extension ProductTypeListViewController { noteLabel.font = noteLabel.font.usingFeatures([.smallCaps]) priceField.format = { Money.parse(as: ConArtist.model.settings.value.currency, $0)?.toString() ?? $0 } if let record = editingRecord { - infoTextView.text = record.info - selected.accept(record.products.compactMap { id in products.value.first { product in product.id == id } }) - priceField.text = "\(record.price.numericValue)" - money.accept(record.price) + DispatchQueue.main.async { + // this part is delayed so that the loading does not override the text field color + self.infoTextView.text = record.info + self.selected.accept(record.products.compactMap { id in + self.products.value.first { product in product.id == id } + }) + self.priceField.text = "\(record.price.numericValue)" + self.money.accept(record.price) + } } startAdjustingForKeyboard() }