rob42
06/12/2024, 12:24 PMfocusProperties
on items within a LazyList
?
I'm trying to set a custom focus order by modifying the next
focusRequester, but if the item is off-screen it will crash with FocusRequester is not initialized
. This seems like a gotcha with focus within a LazyList -- am I wrong?
val req = remember { FocusRequester() }
LazyList {
item {
Box(modifier = Modifier.focusProperties { next = req }.focusable())
}
// .. more items
item {
Box(modifier = Modifier.focusRequester(req).focusable())
}
}