-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Popup content sees previous value of staticCompositionLocal #4558
Popup content sees previous value of staticCompositionLocal #4558
Comments
Can you post a short reproducer? |
Hi @m-sasha, please take a look at https://github.com/Omico/issue-compose-multiplatform-4558. The issue only exists if we change the typography. |
Can you post a short reproducer? |
Reproducer:
Clicking the buttons, the value seen inside the Popup is always the previous value of the local. |
The problem seems to be with a change introduced in JetBrains/compose-multiplatform-core#1086 In Also, I don't entirely understand why a layer needs |
There is no public (outside of
Only if it IS parent composition (
Same as above - it will work ONLY for drawing |
Why does composition depend on where the composables are drawn (canvas)? |
Because in case of single canvas it reuses already existing environment/contexts, but in other cases it cannot do that |
In Android, We, on the other hand, don't pass the parent composition; the new That seems to be why the composition locals aren't propagated automatically. I imagine it has other implications, and possibly bugs, too. |
I'd recommend
|
We can't do that, because popup/dialog can have its recomposition cycle. For example, in a case when they are separate windows showed on another screen with a different refresh rate. The short term solution seems the right solution. Even if the popup content is recomposed not in sync, it should see the most recent composition locals. |
I'm not convinced this necessarily means that we can't have a correct composition hierarchy. Why isn't it possible for each ComposeScene to have its own |
It may be possible in theory if we allow somehow compositions to be recomposed at different pace. How we do that - having one or multiple |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Compose Multiplatform:
1.6.1
2024-03-29_09-19-19.mp4
The text was updated successfully, but these errors were encountered: