fix(VSlider): correct roundValue when min is not a multiple of step#22780
Closed
hellozzm wants to merge 1 commit intovuetifyjs:masterfrom
Closed
fix(VSlider): correct roundValue when min is not a multiple of step#22780hellozzm wants to merge 1 commit intovuetifyjs:masterfrom
hellozzm wants to merge 1 commit intovuetifyjs:masterfrom
Conversation
When min value is not a multiple of step (e.g., min=0.1, step=1), the roundValue function incorrectly used min % step as an offset, causing floating point errors. For example, a thumb value of 25 would display as 25.1 instead of 25. Fixed by computing steps relative to min instead of using an offset. Fixes vuetifyjs#22348
Contributor
|
Just stop posting PRs. We don't need this slop. |
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.
Summary
When
minis not a multiple ofstep(e.g.,min=0.1,step=1), theroundValuefunction inuseStepsincorrectly computesmin % stepas an offset, causing floating point rounding errors. For example, a thumb at value 25 would display as 25.1 instead of 25.The fix computes the number of steps from
minand builds the rounded value from there, avoiding the offset-based approach entirely.Playground Markup
Testing
Fixes #22348