Repository navigation
fix(slider): keep release values within current bounds - #2045
Open
Xapollon430 wants to merge 2 commits into
Open
Xapollon430 wants to merge 2 commits into
Xapollon430 wants to merge 2 commits into
Conversation
|
@Xapollon430 is attempting to deploy a commit to the varletjs Team on Vercel. A member of the Team first needs to authorize it. |
@varlet/cli
@varlet/icons
@varlet/import-resolver
@varlet/preset-tailwindcss
@varlet/preset-unocss
@varlet/shared
@varlet/touch-emulator
@varlet/ui
@varlet/use
@varlet/vite-plugins
commit: |
This branch has not been deployed
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.
Change information
Slider can emit an out-of-range
endvalue when its bounds change during a drag. Drag to 85 with max 100, change max to 60, then release without another move. The current code emits 85. Changing min can also shift the stored step count into a different numeric value at release.Keep the latest numeric value for the active thumb and apply the existing precision/bounds helper at release. In range mode, combine it with the latest controlled value of the inactive thumb and clamp both entries. A value that remains within the new bounds stays unchanged.
Checklist
New regressions cover scalar and range bounds changes, preservation of a valid value after min changes, and a controlled update to the inactive thumb. All 26 Slider tests pass with this change. Scoped lint and formatting checks pass. GitHub CI test and build jobs pass on the final commit.
Commands, run with Node 24.14.1 from
packages/varlet-ui:Related links
Regression tests
Manual reproduction: bind
modelValueandmaxto refs, set max to 60 after a delay fromstart, drag past 60 before the delay expires, hold still, then release.endshould report 60.