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] AlertDialog on IOS don't have animation to avoid keyboard #4210

Closed
hoanghai9650 opened this issue Jan 31, 2024 · 1 comment · Fixed by JetBrains/compose-multiplatform-core#1067
Assignees
Labels
bug Something isn't working input Touch, mouse, keyboard input related ios layers: popup/dialog

Comments

@hoanghai9650
Copy link

hoanghai9650 commented Jan 31, 2024

Describe the bug
I'm using AlertDialog and having TextField inside it.
On Android when I focus the TextField, when keyboard appear, the AlertDialog's move up animation work perfectly, but on IOS there is no animation for that, and IOS don't have animation for appearing that AlertDialog

Another Problem with TextField, I have multiple TextField in Dialog, I'm focusing 1 TextField and select to another TextField, the keyboard of IOS auto closed and reopened, but in Android there is no problem.

Affected platforms
Select one of the platforms below:

  • iOS

Versions

  • Kotlin version*: 1.9.21
  • Compose Multiplatform version*: 1.6.0-beta01
  • OS version(s)* (required for Desktop and iOS issues): 17.2
  • OS architecture (x86 or arm64): arm64

To Reproduce
Steps and/or the code snippet to reproduce the behavior:

  1. Use AlertDialog
  2. Add TextField to it
  3. Focus TextField
  4. Dialog don't have move up animation to avoid keyboard

Expected behavior
Dialog must have move up animation to avoid keyboard on IOS.
Keyboard don't reopen when change focus on another TextField

@hoanghai9650 hoanghai9650 added bug Something isn't working submitted labels Jan 31, 2024
@hoanghai9650 hoanghai9650 changed the title IOS [IOS] AlertDialog on IOS don't have animation to avoid keyboard Jan 31, 2024
@MatkovIvan MatkovIvan added input Touch, mouse, keyboard input related ios layers: popup/dialog and removed submitted labels Jan 31, 2024
@MatkovIvan MatkovIvan self-assigned this Jan 31, 2024
MatkovIvan added a commit to JetBrains/compose-multiplatform-core that referenced this issue Feb 16, 2024
## Proposed Changes

- Add a way to include software keyboard height into `Dialog` centering
calculation.
- Add `DialogProperties.useSoftwareKeyboardInset` option to disable this
behavior.
- Align default behavior with Android (software keyboard affects
`Dialog`)

## Known issues

- Animation lags with `platformLayers = true` on iOS

## Testing

Test: run mpp, DialogWithTextField page

`useSoftwareKeyboardInset = true` | `useSoftwareKeyboardInset = false`
--- | ---
![Simulator Screenshot - iPhone 15 Pro - 2024-02-07 at 16 09
07](https://github.com/JetBrains/compose-multiplatform-core/assets/1836384/efc5100b-12c4-44ae-944e-46a76226abfb)
| ![Simulator Screenshot - iPhone 15 Pro - 2024-02-07 at 16 29
56](https://github.com/JetBrains/compose-multiplatform-core/assets/1836384/45bcf869-0696-4bf9-9b2c-d78682bab8a9)


## Issues Fixed

Fixes JetBrains/compose-multiplatform#4210
@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.

@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 input Touch, mouse, keyboard input related ios layers: popup/dialog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants