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
15.88k stars 1.15k forks source link

[Web] DOM effects race conditions #2053

Open mpetuska opened 2 years ago

mpetuska commented 2 years ago

Currently, we have two ways to reach native HTML element from compose-web context:

  1. AttrsScope::ref
  2. ElementScope::DisposableEffect

However, it seems that #⁠2 are applied before #⁠1.

I believe applying #⁠1 before #⁠2 makes a lot more sense. My reasoning for such order is that attrs (i.e. #⁠1) are part of HTML Element's "metadata" and as such should be resolved before the content (i.e. #⁠2)

okushnikov commented 1 month ago

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