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
14.85k stars 1.08k forks source link

[Dialog] - BasicAlertDialog weird sqeeze animation when showing soft keybaord #4751

Open cmpeguerog opened 2 weeks ago

cmpeguerog commented 2 weeks ago

Describe the bug Dialog layout sqeeze vertically when soft keyboard is being show.

Affected platforms

Versions

To Reproduce

  1. Add a TextField inside a BasicAlertDialog
  2. Request focus to show keyboard as soon as the dialog appears in the composition.

Expected behavior Dialog should slide up without squeeze animation.

Screenshots

https://github.com/JetBrains/compose-multiplatform/assets/22971874/f358cc94-5438-464f-84a0-578c16f8e2d4

MatkovIvan commented 2 weeks ago

It's a known issue and there was a try to migrate this - https://github.com/JetBrains/compose-multiplatform-core/pull/1099

The problem is in low-level sync between native view layout and metal layer rendering.

The current workaround is to disable platform layers via

ComposeUIViewController(
    configure = { platformLayers = false }
)
cmpeguerog commented 2 weeks ago

It's a known issue and there was a try to migrate this - JetBrains/compose-multiplatform-core#1099

The problem is in low-level sync between native view layout and metal layer rendering.

The current workaround is to disable platform layers via

ComposeUIViewController(
    configure = { platformLayers = false }
)

Worked fine, but as a side effect now the user should handle the keyboad when showing dialogs.