FinTecSystems / xs2a-android

[Client] Native Android SDK for Tink Germany XS2A API.
https://tink.com/de/fts
Other
6 stars 4 forks source link

--IllegalStateException Vertically scrollable component was measured with an infinity maximum height-- enableScroll doesn't keep Last State #16

Closed hossamCheck24 closed 11 months ago

hossamCheck24 commented 11 months ago

https://github.com/FinTecSystems/xs2a-android/compare/master...hossamCheck24:xs2a-android:fix_enable_scroll_issue

Hey Mike, could you kindly take a look at this PR? I believe it might address the issue of not maintaining state and ensure that we avoid using the fragment constructor.

maik-mursall commented 11 months ago

Hi @hossamCheck24,

just answered it :)

If your issue still persists, could you maybe create a minimal example app, where you can reproduce this issue and share it with me? With my test-app setup I cannot recreate this problem, even if I use your layouts, etc. :/

hossamCheck24 commented 11 months ago

this issue i couldn't reproduce it till now but i think i fould proper solution for it to make sure that always there are hight for the modifier `@Composable fun FormLinesContainer( formData: List, viewModel: XS2AWizardViewModel ) {

Column(
    verticalArrangement = Arrangement.spacedBy(10.dp),
    modifier = if (viewModel.enableScroll)
        Modifier
            .fillMaxSize()
            .height(IntrinsicSize.Min)
            .verticalScroll(rememberScrollState())

    else
        Modifier
) {
    FormLines(formData, viewModel)
}

}`

check this i try to make it enableScroll true for me and work fine without any problem

By combining Modifier.fillMaxWidth() and setting a specific height using height(IntrinsicSize.Min), you should be able to avoid the crash related to the "infinity maximum height constraints" error.

maik-mursall commented 11 months ago

@hossamCheck24 Yup, that works 👍🏻

I will update you, when I released the fix and then close the Issue.

maik-mursall commented 11 months ago

@hossamCheck24 I just released it under v5.1.3. It will be available on MavenCentral within the next few hours :)

Please reopen this Issue if the problem still occurs.