title: Cannot select item in List
body: <p>I am trying to build a (macOS) view with a sidebar and a main area. The main area contains various custom views rather than a single view with a detail ID. My code looks like this:</p>
  <pre><code>enum SidebarTargetID: Int, Identifiable, CaseIterable {
      case status, campaigns
  
      var id: Int {
          rawValue
      }
  }
  
  struct SidebarView: View {
  
      @Binding var selection: SidebarTargetID?
  
      var body: some View {
          List(selection: $selection) {
              Label(&quot;Status&quot;, systemImage: &quot;heart&quot;).id(SidebarTargetID.status)
              Label(&quot;Campaigns&quot;, systemImage: &quot;heart&quot;).id(SidebarTargetID.campaigns)
          }
      }
  
  }
  
  struct ContentView: View {
  
      @SceneStorage(&quot;sidebarSelection&quot;) private var selectedID: SidebarTargetID?
  
      var body: some View {
          NavigationView {
              SidebarView(selection: selection)
  
              switch selectedID {
              case .status: StatusView()
              case .campaigns: CampaignView()
              default: StatusView()
              }
          }
      }
  
      private var selection: Binding&lt;SidebarTargetID?&gt; {
          Binding(get: { selectedID ?? SidebarTargetID.status }, set: { selectedID = $0 })
      }
  
  }
  </code></pre>
  <p>The sidebar view, however, does not appear to be responding to its items being selected by clicking on them: no seleciton outline, no change of view in the main area.</p>
  <p>Why is this? I have seen a <code>ForEach</code> being used in a <code>List</code> of <code>Identifiable</code> objects whose IDs activate the selection binding and do the selection stuff. What am I doing wrong?</p>
  <h1>EDIT</h1>
  <p>Tried this too, doesn't work.</p>
  <pre><code>enum SidebarTargetID: Int, Identifiable, CaseIterable {
      case status, campaigns
  
      var id: Int {
          rawValue
      }
  }
  
  struct SidebarView: View {
  
      @Binding var selection: SidebarTargetID?
  
      let sidebarItems: [SidebarTargetID] = [
          .status, .campaigns
      ]
  
      var body: some View {
          List(selection: $selection) {
              ForEach(sidebarItems) { sidebarItem in
                  SidebarLabel(sidebarItem: sidebarItem)
              }
          }
      }
  
  }
  
  struct SidebarLabel: View {
      var sidebarItem: SidebarTargetID
  
      var body: some View {
          switch sidebarItem {
          case .status: Label(&quot;Status&quot;, systemImage: &quot;leaf&quot;)
          case .campaigns: Label(&quot;Campaigns&quot;, systemImage: &quot;leaf&quot;)
          }
  
      }
  }
  </code></pre>