title: How to maintain scroll position in LazyVStack / VStack when insert item at the top of a list
body: <p>I create a simple vertical list that contain items to show.</p>
  <p>The problem is when I insert items at the top of the list via <code>insertAtTop()</code>. The scroll view does not stay in the same place.</p>
  <p>See the video: <a href="https://streamable.com/i7ywab" rel="noreferrer">https://streamable.com/i7ywab</a></p>
  <hr />
  <p>How can I make the scroll view stay in the same position?</p>
  <p>Here is the sample code.</p>
  <pre><code>struct TestView: View {
      
      @State private var items: [Item] = []
      
      var body: some View {
          NavigationView {
              ScrollView {
                  LazyVStack {
                      ForEach(items, id: \._id) { item in
                          Text(item.text)
                              .background(Color.green)
                              .padding(.bottom, 10)
                      }
                  }
              }
              .navigationBarItems(trailing: HStack {
                  Button(&quot;[Insert at top]&quot;, action: {
                      insertAtTop()
                  })
                  Spacer(minLength: 20)
                  Button(&quot;[Load]&quot;, action: {
                      load()
                  })
              })
              .navigationTitle(&quot;Item List&quot;)
          }
      }
      
      private func load() {
          items = (1...50).map { _ in Item() }
      }
      
      private func insertAtTop() {
          let newItems = (1...20).map { _ in Item() }
          items.insert(contentsOf: newItems, at: 0)
      }
      
  }
  
  struct TestView_Previews: PreviewProvider {
      static var previews: some View {
          TestView()
      }
  }
  
  struct Item {
      var _id = UUID()
      var text = UUID().uuidString.prefix(5)
  }
  </code></pre>