fix(Slider): ensure thumb position updates when value changes externally#142
Merged
Konyaco merged 1 commit intocompose-fluent:devfrom Jan 15, 2026
Merged
Conversation
Slider thumb position (rawFraction) was only updated during user drag interactions. If the `value` was modified programmatically (e.g., via state hoisting or a reset button), the visual thumb position would remain stale and desynchronized from the actual value. This commit adds a check in the `value` setter to explicitly recalculate and update `rawFraction` when `isDragging` is false, ensuring the UI correctly reflects external state changes.
Konyaco
approved these changes
Jan 15, 2026
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the Slider thumb position would not update when the value was changed programmatically (e.g., via state hoisting or external controls). The fix ensures that rawFraction, which controls the visual thumb position, is synchronized with the value property when changes occur outside of user drag interactions.
Changes:
- Added synchronization logic in the
SliderState.valuesetter to updaterawFractionwhen the value changes externally (when not dragging)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slider thumb position (rawFraction) was only updated during user drag interactions. If the
valuewas modified programmatically (e.g., via state hoisting or a reset button), the visual thumb position would remain stale and desynchronized from the actual value.This commit adds a check in the
valuesetter to explicitly recalculate and updaterawFractionwhenisDraggingis false, ensuring the UI correctly reflects external state changes.