compose-menu icon indicating copy to clipboard operation
compose-menu copied to clipboard

iOS enter animation for Dialog seems not to be working

Open mattegoghero opened this issue 1 year ago • 8 comments

Hi, I've been trying to add a simple dialog in the commonMain part of my composable multiplatform application but when I test it on an iOS emulator (Iphone 16 iOS 18) the enter animation of the dialog and the scrim seems not to be working. The exit animation works fine though.

I'm using version 1.19.1.

val dialogState = rememberDialogState(true)
Dialog(dialogState){
    Scrim(
        enter = fadeIn(tween(durationMillis = 250)),
        exit = fadeOut(tween(durationMillis = 150)),
    )
    DialogPanel(
        enter = scaleIn(initialScale = 0.8f) + fadeIn(tween(durationMillis = 250)),
        exit = scaleOut(targetScale = 0.6f) + fadeOut(tween(durationMillis = 150)),
    ){
        Text("Hello")
    }
}

mattegoghero avatar Nov 12 '24 14:11 mattegoghero

Thanks for opening this issue.

Turns out Dialogs behave a bit different on iOS than the other platforms.

alexstyl avatar Nov 12 '24 17:11 alexstyl

I've tried tackling this a few times and still haven't figured out what is the reason this is happening. It seems like an issue in Compose itself, but I cannot figure this out yet.

Is this blocking you?

alexstyl avatar Dec 01 '24 11:12 alexstyl

Closing due to inactivity. Also seem related to this bug on CMP

alexstyl avatar Jan 03 '25 15:01 alexstyl

is there any news for this issue? I can still reproduce it

akardas16 avatar Jan 24 '25 13:01 akardas16

Opened a bug report on Compose Multiplatform. Kindly star the issue if you want to see it fixed: https://youtrack.jetbrains.com/issue/CMP-7666/AnimatedVisibility-does-not-work-the-same-on-iOS-as-on-Android-and-JVM

alexstyl avatar Feb 23 '25 15:02 alexstyl

Re-opening this until the issue on CMP is fixed.

Even though this is blocked from us to fix, it's work keeping open for visibility.

alexstyl avatar Nov 03 '25 04:11 alexstyl

~~This seems to be worked on from CMP's side: https://youtrack.jetbrains.com/issue/CMP-4365/iOS-Enter-and-exit-animation-for-Dialog~~

EDIT: Seems like my original issue was mistaken for asking for the built in Dialog to have animations. Chasing folks about this to move it forward.

alexstyl avatar Nov 11 '25 05:11 alexstyl

This is no longer blocked by CMP. It is a bug from our side that we should be able to address

alexstyl avatar Nov 11 '25 12:11 alexstyl