Skip to content
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

Fix: BottomSheet closes when recomposing in iOS #330 #362

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

hm-tamim
Copy link
Contributor

@hm-tamim hm-tamim commented Mar 8, 2024

Issue details:
#330
Affected Platform: iOS
Compose version: 1.6.0

It seems the culprit is confirmValueChange in rememberModalBottomSheetState, it's using rememberSaveable where confirmValueChange is used as a key. When this method changes in iOS somehow when you open keyboard or any other thing that causes recomposition, it recreates the sheet state, which hides the bottom sheet modal.

Removing confirmValueChange and using LaunchedEffect to observe sheetState.currentValue solves the issue.

@DevSrSouza
Copy link
Collaborator

DevSrSouza commented Mar 8, 2024

Can we also report this on Compose Multiplatform Issues ?
It should not have different behaviors, the same code in both platforms.

@hm-tamim
Copy link
Contributor Author

hm-tamim commented Mar 8, 2024

Hi @DevSrSouza

I think this one is related
JetBrains/compose-multiplatform#4434

@hm-tamim
Copy link
Contributor Author

hm-tamim commented Mar 8, 2024

Also this one

JetBrains/compose-multiplatform#4435

@DevSrSouza DevSrSouza merged commit 02b0877 into adrielcafe:main Mar 24, 2024
1 check passed
@creativedrewy
Copy link

Thank you for this PR! I just saw this issue myself. Plz cut a new alpha release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants