[Pager] Moving focus selects the next page
If you create a Horizontal pager like this:
HorizontalPager(
count = 4,
state = pagerState
) {
Column {
Text("Page $currentPage")
TextField(
value = textValue.value,
onValueChange = { new ->
textValue.value = new
},
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Next)
)
}
}
If you click the TextField, and then press the next button on the on-screen keyboard, the focus will move to the next element, but the next element is on the next page so the pager will scroll.
I don't think this is intended, but if it is there should be way of preventing this from happening.
As far as I know, the BringIntoView is responsible for scrolling to focused composables, the Pager has nothing to do with it. I didn't find a way to turn it off so far. If you don't find it either, feel free to request the feature in Compose issue tracker.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
If anyone else runs into this, you can work around it by adding Modifier.focusProperties { canFocus = page == pagerState.currentPage } to the root of each page.