-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hello, hope you are well. I think I might have discovered a bug and thought I'd get your thoughts on it.
When I capture text from the camera, my @Bindings are updated successfully. However If I type within the same fields and click another element such as a button, the @Bindings are reverted back into their previous state.
I have the following code
struct ElectronicCategoryView: View {
@Binding var modelNumber: String
@Binding var serialNumber: String
var body: some View {
Group {
ScanTextField("Model Number", text: $modelNumber)
ScanTextField("Serial Number", text: $serialNumber)
}
}
}
The @bindings are bound to a viewModel @published property.
I thought it would be as simple as adding the following code to the ScanTextField but it doesn't seem to work, presumably it's because it's not resigningFirstResponder Have you got any additional thoughts?
public func textFieldDidEndEditing(_ textField: UITextField) {
parent.text = textField.text ?? ""
}
itsrobli
Metadata
Metadata
Assignees
Labels
No labels