compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Offset difference in IME padding between iOS and Android

Open SebastianAigner opened this issue 1 year ago • 1 comments

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 avatar Jun 21 '24 22:06 SebastianAigner

Reproducer attached here: KotlinProject 29.zip

Screenshot 2024-06-22 at 00 40 03

SebastianAigner avatar Jun 21 '24 22:06 SebastianAigner

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

  • once via the PaddingValues received from the Scaffold - applied on the Column
  • second time via the .imePadding() modifier - applied on the Box

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.

petin avatar Jul 19 '24 22:07 petin

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

okushnikov avatar Aug 26 '24 13:08 okushnikov

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

okushnikov avatar Aug 26 '24 13:08 okushnikov