WAI
Status Update
Comments
as...@google.com <as...@google.com> #2
Hey, thanks for reporting it here.
This is intended behavior, as the nodes you see are being kept for potential reuse in case more items appear. In Lazy layouts, you only want to count placed nodes (as it might prefetch/recycle some, but not place them):
rule
.onAllNodesWithTag("ServiceCard")
.filter(SemanticsMatcher("isPlaced") { it.layoutInfo.isPlaced })
.assertCountEquals(4)
We are considering filtering placed nodes automatically (or adding additional APIs for this later).
da...@ifttt.com <da...@ifttt.com> #3
Got it. Thanks!
Description
Jetpack Compose version: 2023.08.00 Jetpack Compose component used: LazyVerticalGrid Android Studio Build: Android Studio Giraffe | 2022.3.1 Patch 1 Kotlin version: 1.9.0
Steps to Reproduce or Code Sample to Reproduce:
The assertion on line 55 fails on compose 2023.08.00 but not the previous version we were on (2023.06.01). Only one item is visible and I would expect that onAllNodesWithTag would return 1 item.
I posted this initially in the kotlin slack here and Andrei from Google asked me to file an issue here.