Is there a way to combine ScrollViewReader and LazyVGrid in order to scroll to a selected item?
It looks like ScrollViewReader only works with ONE column designs like list.
Ideally, something like this would be ideal, but does not work currently.
ScrollViewReader { scroller in
LazyVGrid(columns: columns) {
ForEach(viewModel.tileArray, id: \.id) { thisTile in
MyTileView(viewModel: thisTile)
}
}
.onAppear {
scroller.scrollTo(viewModel.selectedTileID, anchor: nil)
}
}