compose-multiplatform
compose-multiplatform copied to clipboard
[Dialog] - BasicAlertDialog weird sqeeze animation when showing soft keybaord
Describe the bug Dialog layout sqeeze vertically when soft keyboard is being show.
Affected platforms
- iOS
Versions
- Kotlin version*: 1.9.23
- Compose Multiplatform version*: 1.6.10-beta03
- OS version(s)* (required for Desktop and iOS issues): Ventura 13.6.6
- OS architecture (x86 or arm64): x86
- Device (model or simulator for iOS issues): Simulator iPhone 15 Pro running iOS 17.2, iPhone 12 Pro Max running 17.4.1.
To Reproduce
- Add a TextField inside a BasicAlertDialog
- 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
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 }
)
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.
@cmpeguerog My problem is something similar to this, but as you can see in the image below, the BasicAlertDialog is below the keyboard.
I have already added the ComposeUIViewController
configure = {
platformLayers = false
onFocusBehavior = OnFocusBehavior.DoNothing
},
In Android
How did you get the dialog to resize correctly?
Another strange thing is that the density of text and component sizes on iOS seems to get bigger.
@SirFilbido I just added the platformLayers = false.
@cmpeguerog Does your BasicAlertDialog have any settings in the Modifier?
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Fixed by https://github.com/JetBrains/compose-multiplatform-core/pull/1515