Louis
06/28/2021, 12:37 PMtestRule.onNode(hasScrollToKeyAction()).performScrollToIndex(index)
Andrew Neal
06/28/2021, 12:45 PMhasScrollToIndexAction
instead of `hasScrollToKeyAction`*?* Or if that is what you're intending, then maybe using performScrollToKey
instead of performScrollToIndex
is what you need.Jelle Fresen [G]
06/28/2021, 1:30 PMperformScrollToKey
and performScrollToIndex
are meant to be used on lazy lists, such as LazyColumn and LazyRow. They require that the content of the scrolling container respectively has keys and indices associated to them. In a plain column with a scrollable modifier, the content is just one big blob of content, and you'll have to use performScrollTo
on the node you intend to bring into view:
val matcher = /* matcher that matches the content you want to scroll to */
testRule.onNode(matcher).performScrollTo()
Louis
06/28/2021, 1:43 PM