title: Strange behaviour with List View when using custom UITextField(by using UIViewRepresentable) as child views
body: <p>I noticed that the Binding is not working as expected when we use UITextfield as subViews of a SwiftUI List with the help of UIViewRepresentable protocol.</p>
  <p>i have implemented like a dynamic form using List View and the Custom TextField Views, when i was trying to update the value of one field from the list other than first, previously updated elements data getting removed when tapping on done button of the accessory view of textField View.</p>
  <p>I have added the code snippets below related to Custom TextField, List Row and for ListView body</p>
  <p><code>TextField View</code></p>
  <pre><code>struct TextFieldView: UIViewRepresentable {
    
   // MARK: - Internal Properties
    
   private let inputTextField = UITextField()
   public var placeholder: String
   public var keyboardType: UIKeyboardType
   private let actionsHandler = InputAccessoryViewActionsHandler()
    
   @Binding public var value: String?
    
   func makeUIView(context: Context) -&gt; UITextField {
     
    inputTextField.placeholder = placeholder
    inputTextField.textColor = AppTheme.primaryText.color
    inputTextField.font = Font.Roboto.regular.of(size: 16)
    inputTextField.keyboardType = keyboardType
    inputTextField.delegate = context.coordinator
    inputTextField.accessibilityIdentifier = &quot;specValueTextField&quot;
    inputTextField.isAccessibilityElement = true
     
    if keyboardType == .numberPad {
     configureAccessoryView()
    }
    return inputTextField
   }
    
   func updateUIView(_ uiView: UITextField, context: Context) {
    if let value = self.value {
     uiView.text = value
    }
   }
    
   func makeCoordinator() -&gt; Coordinator {
    Coordinator($value)
   }
    
   func configureAccessoryView() {
    // Accessory View
    let toolbar = UIToolbar()
    toolbar.sizeToFit()
    let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace,
                      target: nil,
                      action: nil)
    let doneButton = UIBarButtonItem(title: &quot;Done&quot;.localized,
                     style: .plain,
                     target: self.actionsHandler,
                     action: #selector(self.actionsHandler.doneButtonAction))
    doneButton.tintColor = AppTheme.primary.color
    doneButton.accessibilityIdentifier = &quot;Done&quot;
     
    toolbar.setItems([flexibleSpace, doneButton], animated: true)
     
    self.actionsHandler.doneButtonTapped = {
     self.value = self.inputTextField.text
     self.inputTextField.resignFirstResponder()
    }
    self.inputTextField.inputAccessoryView = toolbar
   }
    
   class InputAccessoryViewActionsHandler {
    public var doneButtonTapped: (() -&gt; Void)?
     
    @objc func doneButtonAction() {
     self.doneButtonTapped?()
    }
   }
    
   class Coordinator: NSObject, UITextFieldDelegate {
    var text: Binding&lt;String?&gt;
     
    init(_ text: Binding&lt;String?&gt;) {
     self.text = text
    }
     
    func textField(_ textField: UITextField,
            shouldChangeCharactersIn range: NSRange,
            replacementString string: String) -&gt; Bool {
     if let currentValue = textField.text as NSString? {
      let proposedValue = currentValue.replacingCharacters(in: range, with: string)
      self.text.wrappedValue = proposedValue
     }
     return true
    }
    func textFieldShouldReturn(_ textField: UITextField) -&gt; Bool {
     textField.resignFirstResponder()
     return true
    }
   }
  }
  
  </code></pre>
  <p><code>List Row Element view </code></p>
  <pre><code>struct SpecificationRow: View {
    @Binding var specification: ClassificationSpecItem
   // MARK: - Body
    
   var body: some View {
    VStack(alignment: .leading) {
     TextFieldView(placeholder: &quot;Enter value&quot;,
            keyboardType: keyboardType,
            value: $specification.specValue)
    }.padding(EdgeInsets(top: 12, leading: 0, bottom: 5, trailing: 0))
   }
  }
  
  </code></pre>
  <p><code>and the list body is like below </code></p>
  <pre><code>  var body: some View {
    VStack {
     List($viewModel.specifications) { $spec in
         SpecificationRow(specification: $spec)
  }
  }
  </code></pre>
  <p>the viewModel was confirmed to ObservableObject and the specifications property was a @Published property</p>
  <p>Am I missing something? Or is this just a bug in SwiftUI? Any help would be greatly appreciated! Thanks!</p>