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

The composition is completely destroyed #3661

Closed artsmvch closed 2 months ago

artsmvch commented 1 year ago

Describe the bug The composition is completely destroyed and recreated when the view controller goes through viewDidDisappear / viewWillAppear.

Affected platforms

Versions

To Reproduce The code snippet is here. It's a simple screen with a button that calls Stripe payment sheet. I cannot share details about Stripe configuration and payment options. Steps to reproduce the behavior:

  1. Press the button.
  2. Stripe payment sheet will be shown.
  3. See that the composition is disposed and gone.
  4. Close the payment sheet.
  5. See that the composition is created and shown again.

Expected behavior The composition is not disposed.

Video

https://github.com/JetBrains/compose-multiplatform/assets/61359788/0e74d718-cbf6-4bdd-b49c-ef1c0221e58f

Additional context The problem appeared after migrating from version 1.4.3 to version 1.5.1. Looks like the breaking change was introduced in this commit. And Stripe indirectly calls viewDidDisappear after the bottom sheet animation is complete here.

okushnikov commented 3 months ago

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