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
16.27k stars 1.18k forks source link

Allow disabling stylistic animations for controls. #4138

Closed mgroth0 closed 10 months ago

mgroth0 commented 10 months ago

In JavaFX when we create a ChoiceBox and click on it, the dropdown menu appears instantly. When it loses focus, it disapears instantly.

In Compose, the opening and closing dropdown menus animate. Not only is the timings of this animation hardcoded, but also the animation as a whole cannot be disabled.

Optional, stylistic animation of controls like this should be configurable. Sometimes it is desirable to have a more "comfy" feel to the app (which is how I would describe the default animation behavior). Other times, it is more desirable to have a more responsive and fast feel.

I am focusing on DropdownMenu here, but this is a request for an overall strategy of making all optional, stylistic animations configurable. At minimun, we should be able to disable them with a boolean input property or a CompositionalLocal toggle.

See androidx.compose.material.DropdownMenuContent for Desktop for a reference for where some animations are hardcoded.

pjBooms commented 10 months ago

I believe it should be configurable not only for Desktop but for other targets as well that should be addressed in Jetpack Compose first. Please create an issue in Jetpack Compose issue tracker for this. Closing this issue.

mgroth0 commented 10 months ago

https://issuetracker.google.com/issues/321263823

okushnikov commented 4 months ago

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