I have a scrollable column (non lazy) and I do
myStuff.forEach{
someCard(stuffItem)
}
and someCard inside also does a forEach which outputs content. Essentially the list if 5 "cards" and then each card has a row item inside of it.
How can I scroll to an inner item position? i.e. I want to scroll to a specific item within a specific card?
f
FunkyMuse
04/13/2023, 3:42 PM
Which outputs content in what type of parent?
It outputs the content i presume in a column/row, you can control that scrollable state?
c
Colton Idle
04/13/2023, 3:48 PM
The outer forloop + column is scrollable. The inner forloop is a column, but not scrollable.
But the entire page scrolls just fine because of the outer scrollable column.
o
Oleksandr Balan
04/13/2023, 8:49 PM
If I am not mistaken the ScrollState has no method to scroll to the specific item, it scrolls only to the given offset. So you have to remember some map with global indices and offsets which you will fill in each items "onGloballyPositioned" modifier. And then you could use that map to identify offset of the each item and scroll to it.
f
FunkyMuse
04/14/2023, 5:21 AM
You can always use a lazycolumn within lazycolumn and scroll to item position, no?