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

Todo example does not work when coroutines are added to the main module #103

Closed arkivanov closed 3 years ago

arkivanov commented 4 years ago

STR:

Actual: the window is blank Expected: a working app

I see that all Composable functions are triggered with valid data but nothing is rendered. Looks like the Crossfade function becomes broken. Removing Crossfade fixes the issue:

Index: examples/todoapp/common/root/src/commonMain/kotlin/example/todo/common/root/integration/TodoRootImpl.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- examples/todoapp/common/root/src/commonMain/kotlin/example/todo/common/root/integration/TodoRootImpl.kt (revision 1b294335a9394ba32c042e5aaee5021a7a288c91)
+++ examples/todoapp/common/root/src/commonMain/kotlin/example/todo/common/root/integration/TodoRootImpl.kt (date 1605354747181)
@@ -63,9 +63,7 @@
     @Composable
     override fun invoke() {
         router.state.children { child, configuration ->
-            Crossfade(currentChild = child, currentKey = configuration) { currentChild ->
-                currentChild()
-            }
+            child()
         }
     }
CarsonRedeye commented 4 years ago

I noticed on my app adding coroutines makes TextFields very buggy and very few keystrokes are recognised

CarsonRedeye commented 4 years ago

FYI org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 works OK with TextFields, but org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.0-M1 or higher does not.

igordmn commented 3 years ago

Fixed in 0.2.0-build128. I checked that todoapp works if we add coroutines 1.4.1 in main module.

Was fixed in: https://android-review.googlesource.com/c/platform/frameworks/support/+/1495139

okushnikov commented 2 months ago

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