holy smokes that worked. thank you so much. I really appreciate your help!
Soln
Add an observable for to 'catch' when we need to scroll to a row / DataID: @State private var scrollToTableRow: DataIDClass?
Expose a scrolling proxy at the outermost view container (in my case, above a Vstack): some View { ScrollViewReader { (proxy:ScrollViewProxy) in VStack { ...beautiful UI here ... }
Add a scrollToTableRow listener to the Table (nestled inside the Vstack): Table(...){ ... }.onChange(of: scrollToTableRow) { target in unwrap target, scrollToTableRow=nil, withAnimation { proxy.scrollTo(target, anchor: .top) }
In the find Button action, add scrollToTableRow=selection.first
I need to figure out a few minor details from here (setting focus to Table; remembering the first DataId in the next chunk). I am glad it worked, though I had my doubts! very cool. thank you thank you.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: