As an experiment I tried a private state variable for the selection. Selections are highlighted (but the detail is broken), but as soon as I hook up the onChange, the detail works but the selections fail
struct ContentStringX: View {
let content = [StringItem(item: "Here"), StringItem(item: "There"), StringItem(item: "Everywhere") ]
@Binding var selection : StringItem?
@State private var selPriv : StringItem?
var body: some View {
List(content, selection: $selPriv) { c in
NavigationLink(value: c) {
Text(c.item)
}
}
.onChange(of: selPriv) { new in
selection = selPriv
}
}
}