Skip to content
New issue

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

Offset difference in IME padding between iOS and Android #5009

Open
SebastianAigner opened this issue Jun 21, 2024 · 4 comments
Open

Offset difference in IME padding between iOS and Android #5009

SebastianAigner opened this issue Jun 21, 2024 · 4 comments
Assignees
Labels
bug Something isn't working ios

Comments

@SebastianAigner
Copy link
Member

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 SebastianAigner added bug Something isn't working submitted labels Jun 21, 2024
@SebastianAigner
Copy link
Member Author

SebastianAigner commented Jun 21, 2024

Reproducer attached here: KotlinProject 29.zip

Screenshot 2024-06-22 at 00 40 03

@petin
Copy link

petin commented Jul 19, 2024

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.

@okushnikov
Copy link

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

1 similar comment
@okushnikov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ios
Projects
None yet
Development

No branches or pull requests

5 participants