Skip to content

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

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

Closed
cmpeguerog opened this issue May 2, 2024 · 7 comments
Assignees
Labels
bug Something isn't working ios layers: popup/dialog rendering Low level rendering

Comments

@cmpeguerog
Copy link

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

  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

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-05-02.at.14.29.43.mp4
@cmpeguerog cmpeguerog added bug Something isn't working submitted labels May 2, 2024
@MatkovIvan MatkovIvan added rendering Low level rendering ios and removed submitted labels May 2, 2024
@MatkovIvan
Copy link
Member

MatkovIvan commented May 2, 2024

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 }
)

@cmpeguerog
Copy link
Author

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.

@SirFilbido
Copy link

SirFilbido commented Aug 7, 2024

@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
},

355980157-04645589-de65-438e-8388-a834c7c5ee03

In Android

Screenshot_20240807_185622

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.

@cmpeguerog
Copy link
Author

@SirFilbido I just added the platformLayers = false.

@SirFilbido
Copy link

@cmpeguerog Does your BasicAlertDialog have any settings in the Modifier?

@okushnikov
Copy link
Collaborator

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

@MatkovIvan
Copy link
Member

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working ios layers: popup/dialog rendering Low level rendering
Projects
None yet
Development

No branches or pull requests

5 participants