We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pages not calling onPageSelected, for example, if swiped slowly to page
Decompose: 2.1.4
sealed class PageConfig : Parcelable { @Parcelize data object Page1: PageConfig() @Parcelize data object Page2: PageConfig() } class PageComponent(val page: PageConfig) @ExperimentalDecomposeApi class PagesComponent(context: ComponentContext): ComponentContext by context { private val navigation = PagesNavigation<PageConfig>() val tabs: Value<ChildPages<PageConfig, PageComponent>> = childPages( source = navigation, initialPages = { Pages( items = listOf( PageConfig.Page1, PageConfig.Page2, ), 0 ) }, ) { config, _ -> return@childPages PageComponent(config) } fun selectPage(page: Int) { navigation.select(page) } } @ExperimentalDecomposeApi @Preview @Composable fun PagesIssue() { val lifecycleOwner = LocalLifecycleOwner.current val component = remember { PagesComponent(DefaultComponentContext(lifecycleOwner.lifecycle.asEssentyLifecycle())) } val pages by component.tabs.subscribeAsState() Column { Text( text = "${pages.selectedIndex}", ) Pages( pages = component.tabs, modifier = Modifier.weight(1f), onPageSelected = component::selectPage ) { index, page -> Text( text = "${page.page}", modifier = Modifier .fillMaxSize() .wrapContentSize(align = Alignment.TopCenter) .padding(top = 12.dp) ) } } }
The text was updated successfully, but these errors were encountered:
Hello. I believe this should be fixed in Compose 1.6.0-alpha08. Please try this version.
Sorry, something went wrong.
yeah, fixed(checked in 1.6.0-beta01)
No branches or pull requests
Pages not calling onPageSelected, for example, if swiped slowly to page
Decompose: 2.1.4
Screen_recording_20231114_115241.mp4
The text was updated successfully, but these errors were encountered: