Can someone explain why the `HorizontalViewPager` ...
# compose
g
Can someone explain why the
HorizontalViewPager
on the last page of the
VerticalPager
doesn’t scroll and if theres anyway to fix it please? It works on all the other pages
Copy code
@Preview
@Composable
fun broken() {
    val metrics = WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(LocalContext.current)
    val metricsHeight = (metrics.bounds.height() / LocalDensity.current.density)
    val minHeight = (metricsHeight * .8f).dp
    val items = listOf(1,2,3)
    val pager = rememberPagerState { items.size }
    VerticalPager(state = pager, modifier = Modifier.fillMaxSize(), pageSize = PageSize.Fixed(minHeight)) { index ->
        Column(modifier = Modifier) {
            Text("vertical $index")

            val horizontalPagerState = rememberPagerState { items.size }
            HorizontalPager(horizontalPagerState, modifier = Modifier.fillMaxSize()) {
                Text("index $it", modifier = Modifier.fillMaxSize())
            }
        }
    }
}
h
mm weird, it works fine btw if you dont multiply the minheight by 0.8 ( i just set it to 1 for testing and it worked) , not really sure what's causing the problem . I have a theory imma test it and get back to you
ok i figured it out kinda
g
oh right yeah thats normal, I should have said really. the pagesize is the problem but only breaks for the last page
so i opened a bug here, if you lose even 1 pixel via pagesize it breaks it