Describe the bug
The userScrollEnable = false is to prevent users from sliding and switching between pages on a Pager, allowing switching between different pages to be completely controlled by the logic set by the developer, such as automatically jumping through a button click or triggering a specific event, but tag navigation breaks this logic.
Affected platforms
Desktop (Windows)
Versions
Libraries:
Compose Multiplatform version: 1.6.10
Kotlin version: 2.0.0
OS version(s) (required for Desktop and iOS issues): Windows 11
OS architecture (x86 or arm64): arm64
JDK (for desktop issues): 21
To Reproduce
Steps to reproduce the behavior:
Run this code snippet:
@Composable
fun BugReproduction() {
val pagerState = rememberPagerState {
2
}
VerticalPager(
state = pagerState,
modifier = Modifier
.fillMaxSize(),
beyondBoundsPageCount = 1,
userScrollEnabled = false
) { page ->
when (page) {
0 -> {
// Focusable elements
}
1 -> {
// Focusable elements
}
}
}
}
Use tab navigation.
When focusing on the last focus element in the first page, click the Tab button again, and Pager will scroll to the second page and focus on the focus element of the second page.
Another point: If scrollable elements such as LazyColumn/LazyRow are used in the first Pager, using tab navigation multiple times may cause the Pager to get stuck in the middle of the page switch. And userScrollEnable = false makes it impossible for users to scroll through the Pager.
Expected behavior
I think userScrollEnable = false should prevent users from switching pages of the Pager through tag navigation.
Describe the bug The
userScrollEnable = false
is to prevent users from sliding and switching between pages on a Pager, allowing switching between different pages to be completely controlled by the logic set by the developer, such as automatically jumping through a button click or triggering a specific event, but tag navigation breaks this logic.Affected platforms
Versions
To Reproduce Steps to reproduce the behavior:
Run this code snippet:
userScrollEnable = false
makes it impossible for users to scroll through the Pager.Expected behavior I think
userScrollEnable = false
should prevent users from switching pages of the Pager through tag navigation.