JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.33k stars 1.18k forks source link

Offset difference in IME padding between iOS and Android #5009

Closed SebastianAigner closed 2 months ago

SebastianAigner commented 5 months ago

I have code like this:

Box(Modifier.fillMaxSize().imePadding(), contentAlignment = Alignment.BottomCenter) {
    NewTodoItemButton {
        // ...
    }
}

...that is nested inside a Scaffold. Seems to me like the padding isn't taking into account the surrounding Scaffold on iOS, but it is on Android.

Android (expected):

Screenshot 2024-06-22 at 00 01 52

iOS (actual): IMG_7393

SebastianAigner commented 5 months ago

Reproducer attached here: KotlinProject 29.zip

Screenshot 2024-06-22 at 00 40 03
petin commented 4 months ago

In your example project, you are applying the bottom (safe area) padding twice:

On android it works properly, because you did not enable edgeToEdge in your activity. (enableEdgeToEdge()). Without edgeToEdge, the imePadding/padding(it) has no effect.

I suggest to enable edgeToEdge for android, and remove the imePadding modifier.

okushnikov commented 3 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov commented 3 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.