Fix Down on Home moving focus sideways within a row #20
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/card-lift-focus-bounds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On the Home screen, pressing Down from a card in "Suggested for you" often moved focus to the next card in the same row instead of into Favorites / Recent, so it took several presses to get down.
Cause
Focusablelifted the focused card 2dp withgraphicsLayer { translationY }. That transform also moves the card's focus bounds, so its row neighbours sit 2dp lower and count as "below" it in Compose's 2D focus search. Depending on horizontal distance, a neighbour could beat the card in the next row.Fix
Draw the lift with
drawWithContent { translate(...) }instead. It looks the same, but layout and focus bounds stay where they are.Testing