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

When restoring the Sheet with rememberSaveable(), the display state of the Sheet is incorrect. #48

Open
seanutf1 opened this issue Aug 18, 2024 · 0 comments

Comments

@seanutf1
Copy link

Please complete the following information:

  • Library Version: v0.1.4
  • Affected Device(s) : The built-in Android Studio emulator, API 35

Describe the Bug:

Well, you can look this video from below. On the Android side, click the non modal button, and the sheet will be displayed. When the Sheet is in the fullyExpanded state, switch to the Settings app through the task manager interface, open the Display options, and then turn on or off the Dark mode in the Display interface. After returning to the demo app, the Sheet no longer displays. So click the non modal button again, the Sheet shows up, but because it is reloaded from memory, the display state of the Sheet is not the fullyExpanded state, it's intermediatelyExpanded state, which is not the expected result.

Screen_recording_20240817_233519.mp4

Expected Behavior:

Restore to whatever state it was in before the configuration was changed.

btw,In this case, when the variable SheetState is obtained through rememberSaveable(), the Full state is the initial state value, which leads to the value of hasIntermediatelyExpandedState being true. As a result, the targetStateValue becomes the intermediate state. Therefore, calling the show() method in FlexibleBottomSheet will display the sheet in an intermediate state style. I'm not sure whether it's considered a bug or a feature; in any case, I find this mechanism for restoring the state to be confusing and strange. So, is it or add a configuration variable to implement calling other ShowSheet state methods instead of the default show() method?

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

No branches or pull requests

1 participant