Scroll
Keeping the cursor on screen, and back to the top when the lit tab is chosen again.
Desktop
arkui::scroll
scroll::reveal keeps the cursor on screen as j and k walk past the edge of a list.
arkui::scroll
Keeping a keyboard cursor on screen.
reveal(id, grid, at)reveal_to(id, progress)
Mobile
Asking for the latest capture…
Where
ui/Tabs.kt: ScrollsToTop
How
- ScrollsToTop(listState) or ScrollsToTop(gridState) inside a tab's page: a Reselect scrolls it home.
Asking for the latest capture…
Where
The system's: TabView with a NavigationStack per tab
How
- Nothing to add: the shown tab, tapped again, takes its stack back to its root and then its list to the top.
- To do it from code, ScrollViewReader's scrollTo(first, anchor: .top) inside withAnimation(Springs.move). The recording sets a ScrollPosition a frame at a time along Springs.move's curve, which plays the same.
Asking for the latest capture…
Asking for the latest capture…