title: SwiftUI: Slider in List/ForEach behaves strangely
body: <p>It's very hard to explain without a recording from a second device that I don't have, but when I try to slide my slider, it will stop when my finger is definitely still moving.</p>
  <p>I have my code posted below. I'd be happy to answer any questions and explain whatever. I'm sure it's something really simple that I should know. Any help would be very much appreciated, thanks!</p>
  <pre><code>import SwiftUI
      
      class SettingsViewModel: ObservableObject {
          @Published var selectedTips = [
              10.0,
              15.0,
              18.0,
              20.0,
              25.0
          ]
          
          func addTip() {
              selectedTips.append(0.0)
              selectedTips.sort()
          }
          
          func removeTip(index: Int) {
              selectedTips.remove(at: index)
              selectedTips = selectedTips.compactMap{ $0 }
          }
      }
      
      struct SettingsTipsView: View {
          @StateObject var model = SettingsViewModel()
          
          var body: some View {
              List {
                  HStack {
                      Text(&quot;Edit Suggested Tips&quot;)
                          .font(.title2)
                          .fontWeight(.semibold)
                      
                      Spacer()
                      
                      if(model.selectedTips.count &lt; 5) {
                          Button(action: { model.addTip() }, label: {
                              Image(systemName: &quot;plus.circle.fill&quot;)
                                  .renderingMode(.original)
                                  .font(.title3)
                                  .padding(.horizontal, 10)
                          })
                              .buttonStyle(BorderlessButtonStyle())
                      }
                  }
                  
                  ForEach(model.selectedTips, id: \.self) { tip in
                      let i = model.selectedTips.firstIndex(of: tip)!
                      
                      //If I don't have this debug line here then the LAST slider in the list tries to force the value to 1 constantly, even if I remove the last one, the new last slider does the same. It's from a separate file but it's pretty much the same as the array above. An explanation would be great.
                      Text(&quot;\(CalculatorViewModel.suggestedTips[i])&quot;)
      
                      HStack {
                          Text(&quot;\(tip, specifier: &quot;%.0f&quot;)%&quot;)
                          Slider(value: $model.selectedTips[i], in: 1...99, label: { Text(&quot;Label&quot;) })
                          
                          if(model.selectedTips.count &gt; 1) {
                              Button(action: { model.removeTip(index: i) }, label: {
                                  Image(systemName: &quot;minus.circle.fill&quot;)
                                      .renderingMode(.original)
                                      .font(.title3)
                                      .padding(.horizontal, 10)
                              })
                                  .buttonStyle(BorderlessButtonStyle())
                          }
                      }
                  }
              }
          }
      }
  </code></pre>