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 Material3 slider getting stuck while dragging #1135

Merged
merged 2 commits into from Feb 26, 2024
Merged

Conversation

m-sasha
Copy link

@m-sasha m-sasha commented Feb 26, 2024

...due to recreation of SliderState when onValueChangeFinished changes

Proposed Changes

  • Change SliderState.onValueChangeFinished to be var with internal set.
  • In Slider, remove onValueChangeFinished from the list of keys used when remembering SlideState.
  • Update SliderState.onValueChangeFinished whenever the onValueChangeFinished argument changes.

Testing

Test: Added a unit test.

Issues Fixed

Fixes: JetBrains/compose-multiplatform#4366

@m-sasha m-sasha merged commit 8918c6f into jb-main Feb 26, 2024
6 checks passed
@m-sasha m-sasha deleted the m-sasha/slider-fix branch February 26, 2024 12:54
igordmn pushed a commit that referenced this pull request Feb 26, 2024
…create `SliderState` when it changes (#1135)

(cherry picked from commit 8918c6f)
igordmn pushed a commit that referenced this pull request Mar 4, 2024
@m-sasha m-sasha added the changelog1.6.1 Temporary label for 1.6.1 changelog (will be removed) label Mar 12, 2024
@m-sasha m-sasha changed the title Fix Material3 slider to update onValueChangeFinished rather than recreate SliderState when it changes Fix Material3 slider getting stuck while dragging due to recreation of SliderState when onValueChangeFinished changes Mar 12, 2024
@m-sasha m-sasha changed the title Fix Material3 slider getting stuck while dragging due to recreation of SliderState when onValueChangeFinished changes Fix Material3 slider getting stuck while dragging Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog1.6.1 Temporary label for 1.6.1 changelog (will be removed)
Projects
None yet
3 participants