Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Jetpack Compose component(s) used: Foundation library
Android Studio Build: Android Studio Ladybug | 2024.2.1 Patch 2, Build #AI-242.23339.11.2421.12550806
Kotlin version: 2.0.0
Steps to Reproduce or Code Sample to Reproduce:
When using `LazyListState` in a `LazyColumn` with a non-zero vertical `contentPadding` on WearOS, the `firstVisibleItemIndex` and corresponding `firstVisibleItemScrollOffset` values are calculated incorrectly.
As a workaround, you can use `lazyListState.layoutInfo.visibleItemsInfo.firstOrNull()?.index`. This indicates that the underlying `visibleItemsInfo` collection contains the correct data; however, it is not propagated to `firstVisibleItemIndex`.
The issue is reproducible in the sample project
```kotlin
val firstVisibleIndex = lazyListState.layoutInfo.visibleItemsInfo.firstOrNull()?.index ?: 0
val firstVisibleIndexIncorrect = lazyListState.firstVisibleItemIndex
```