Folks,
I have a SwiftUI view with a fairly simple table, nothing fancy:
Table(itemsToDisplay, selection: $selectedLines, sortOrder: $sortOrder)
{…}
Then I have created a Deselect all command added in the Edit menu, which toggles a boolean state variable called deselect, and I've written this modifier:
.onChange(of: deselect) {_ in selectedLines = Set<TableEntry.ID>(); deselect = false}
While this correctly deselects all visible rows, it turns out the hidden rows are not deselected and show up highlighted when the table is scrolled up or down. Is that the expected behaviour? How am I supposed to deselect all rows, including the invisible ones?
Thanks a bunch! V.
P.S: I’m using the latest MacOS 13 beta SDK with the latest Xcode beta (14.1ß3)