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

iOS. Reduce recompositions during keyboard showing #4435

Closed
igordmn opened this issue Mar 5, 2024 · 1 comment
Closed

iOS. Reduce recompositions during keyboard showing #4435

igordmn opened this issue Mar 5, 2024 · 1 comment
Labels

Comments

@igordmn
Copy link
Collaborator

igordmn commented Mar 5, 2024

Compose 1.6.0

When iOS keyboard appears, the whole app recomposes. It most probably happens because in https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/uikit/KeyboardOverlapHeight.uikit.kt#L27 staticCompositionLocalOf is used. staticCompositionLocalOf recomposes the whole UI tree every time it changes. As changing the height of the keyboard is an often thing, it is not a good thing to recompose everything.

If keyboard is animated, the whole app recomposes every frame.

The solution is to replace staticCompositionLocalOf by compositionLocalOf.

@igordmn
Copy link
Collaborator Author

igordmn commented Mar 5, 2024

Reported here #4434

@igordmn igordmn closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant