title: Can't select Picker
body: <p>I am trying to make a stock control system in SwiftUI where users can add an ingredient and then ad an amount and then select a unit of measurement(kg, g, l ,ml).</p>
  <p>The app allows them to click a button which allows them to add an ingredient to a text-box which is created and then their input is added to a list.</p>
  <p>I am having trouble allowing the user to also type in a number in a text-box next to the ingredient text-box and making the picker clickable</p>
  <p>Here is my code</p>
  <pre><code>import SwiftUI
  struct UploadView2: View {
      
      @State var ingredients = [String]()
      @State var amount = [String]()
      @State var choices = [&quot;g&quot;, &quot;kg&quot;, &quot;ml&quot;, &quot;l&quot;]
      @State var choosen: String = &quot;&quot;
      
      @EnvironmentObject var viewRouter: ViewRouter
      
      func getBinding(forIndex index: Int) -&gt; Binding&lt;String&gt; {
          return Binding&lt;String&gt;(get: { ingredients[index] },
                                 set: { ingredients[index] = $0 })
      }
      
      var body: some View {
          VStack{
              HStack{
                  Button {
                      print(&quot;Going Back&quot;)
                      viewRouter.currentPage = .UploadView
                  } label: {
                      Image(systemName: &quot;arrow.left&quot;)
                          .font(.system(size: 30))
                          .foregroundColor(.black)
                  }
                  .padding(.horizontal)
                  Spacer()
                  Text(&quot;Add Ingredients&quot;)
                      .font(.system(size: 30))
                      .fontWeight(.bold)
                  Spacer()
                  Button {
                      print(&quot;Saved&quot;)
                  } label: {
                      Image(systemName: &quot;bookmark&quot;)
                          .font(.system(size: 30))
                          .foregroundColor(.black)
                  }
                  .padding()
              }
              Form {
                  ForEach(0..&lt;ingredients.count, id: \.self) { index in
                      HStack {
                          Button(action: { ingredients.remove(at: index) }) {
                              Image(systemName: &quot;minus.circle.fill&quot;)
                                  .foregroundColor(.red)
                                  .padding(.horizontal)
                          }
                          TextField(&quot;Ingredient&quot;, text: getBinding(forIndex: index))
  
                              Picker(&quot;&quot;, selection: $choosen){
                                  ForEach(choices, id: \.self) { i in
                                      Text(&quot;\(i)&quot;).tag(i)
                                  }
                              }
                          
                      }
                  }
                  Button(action: { ingredients.append(&quot;&quot;) }) {
                      HStack {
                          Image(systemName: &quot;plus&quot;)
                              .foregroundColor(.black)
                              .padding(.horizontal)
                          Text(&quot;add an ingredient&quot;)
                              .foregroundColor(.black)
                      }
                      
                  }
              }
              Button {
                  //change view router
                  //add data to data class
                 
                  viewRouter.currentPage = .UploadView3
              } label: {
                  Label(&quot;next&quot;, systemImage: &quot;arrow.right&quot;)
              }
              
              .padding()
              .frame(width: 100)
              .foregroundColor(Color.white)
              .background(Color.red)
              .cornerRadius(8)
          }
          
      }
  }
  
  
  struct UploadView2_Previews: PreviewProvider {
      static var previews: some View {
          UploadView2()
              .previewDevice(PreviewDevice(rawValue: &quot;iPhone 13&quot;))
              .previewInterfaceOrientation(.portrait)
          UploadView2()
              .previewDevice(PreviewDevice(rawValue: &quot;iPhone 8&quot;))
      }
  }
  </code></pre>
  <p>When i click on my click it removes the text-box like the dismiss button</p>
  <p>My overall goal is to have a text-box to enter an ingredient and then a text-box to enter an amount and then a picker to select a unit of measurement.</p>
  <p>How can I achieve this using my current code as much as I can?</p>