title: Why does Context Menu display the old state even though the List has correctly been updated?
body: <p>I'm facing an issue where the displayed <code>Context Menu</code> shows the wrong data, even though the <code>List</code> underneath displays the correct one. The issue is that once triggering the action on the context menu of the first item, you'll see how the <code>List</code> re-renders and shows the correct data but if you trigger the context menu again for the first item, it won't show the correct state. If you open the context menu for the second item, it will display the correct state, but if you now select &quot;Two&quot;, and open the same context menu, the <code>State</code> will be wrong (it'll display only 1 selected when it should show 1 &amp; 2, like the <code>List</code> displays it).</p>
  <p>It feels like it's off by one (like presenting the previous state instead of the latest one) and I'm not sure if it's just a bug or I'm using it wrong.</p>
  <p>Here's a snippet of code to reproduce the issue:</p>
  <pre class="lang-swift prettyprint-override"><code>@main
  struct ContextMenuBugApp: App {
      
      let availableItems = [&quot;One&quot;, &quot;Two&quot;, &quot;Three&quot;, &quot;Four&quot;, &quot;Five&quot;]
      @State var selectedItems: [String] = []
      
      var body: some Scene {
          WindowGroup {
              List {
                  ForEach(availableItems, id: \.self) { item in
                      HStack {
                          let isAlreadySelected = selectedItems.contains(item)
                          Text(&quot;Row \(item), selected: \(isAlreadySelected ? &quot;true&quot; : &quot;false&quot;)&quot;)
                      }.contextMenu {
                          ForEach(availableItems, id: \.self) { item in
                              let isAlreadySelected = selectedItems.contains(item)
                              Button {
                                  isAlreadySelected ? selectedItems.removeAll(where: { $0 == item }) : selectedItems.append(item)
                              } label: {
                                  Label(item, systemImage: isAlreadySelected ? &quot;checkmark.circle.fill&quot; : &quot;&quot;)
                              }
                          }
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  <p>Video demonstrating the issue: <a href="https://twitter.com/xmollv/status/1412397838319898637" rel="noreferrer">https://twitter.com/xmollv/status/1412397838319898637</a></p>
  <p>Thanks!</p>
  <h2>Edit:</h2>
  <p>It seems to be an iOS 15 regression (at least on Release Candidate), it works fine on iOS 14.6.</p>