Assigned
Status Update
Comments
ha...@nrk.no <ha...@nrk.no> #2
Also copying
If I add a Row
with a Button
before the LazyColumn
, then the Button
is the item that recieves focus, so it's not necessarily an item within the same LazyColumn that "steals" focus. I imagine it's giving focus to the item closest to the top left corner of the screen (0, 0)
Description
Jetpack Compose version: BOM 2024.09.00
Jetpack Compose component(s) used: LazyColumn and a focusable item like Button
Android Studio Build: Android Studio Koala | 2024.1.1 Patch 1
Kotlin version: 2.0.20
This is a duplicate of https://issuetracker.google.com/issues/365706545 . It's not receiving any attention in the foundation component so I'm trying in the TV component instead. This is a blocker for us for bumping to Compose 1.7 so we would really like to see this fixed. Please close one of the issues depending on where it belongs best.
Please see this sample repo:https://github.com/hakonschia/compose-1.7-focus/blob/main/app/src/main/java/com/example/scrolling/MainActivity.kt
This is for TV apps where you navigate focusable items with a DPAD
When you click on an item in a LazyColumn so that you navigate to a different framgent then focus automatically transfers to a different item (I believe it sets it to the first visible item the LazyColumn has). This does not happen on BOM 2024.08.00 (1.6.8) and is new in 2024.09.00 (1.7.0)
On 2024.09.00 this is logged. When moving to fragment B then "Button 7" recieves focus, which is not from a user interaction
On 2024.08.00 this is logged, as expected focus does not move away from "Button 10":
In our app this is pretty noticeable as the list clearly scrolls and we lose the focus position, so when we return to the fragment the scroll position isn't on the item the user clicked