Skip to content

fix(slider): ignore marks outside current bounds - #8613

Open
Xapollon430 wants to merge 1 commit into
vueComponent:mainfrom
Xapollon430:codex/fix-slider-commit-bounded-marks
Open

Xapollon430 wants to merge 1 commit into
vueComponent:mainfrom
Xapollon430:codex/fix-slider-commit-bounded-marks

Conversation

@Xapollon430

Copy link
Copy Markdown

This is a ...

  • Bug fix

What's the background?

A marks-only Slider can commit a stale mark outside its new bounds. Start at 80 with step=null, marks at 0, 20, 80, 100, and max 100. Change max to 60 during a drag, then release. Range clamping produces 60, but mark alignment selects 80 again, so afterChange reports 80.

API realization

Ignore marks outside the current min/max when aligning values. If no points remain, return a value within the bounds. Keep valid remaining marks selectable.

The regression exercises the actual alignment utility and the Slider's actual setChangeValue and onEnd methods. A focused remote source-method fixture reports aligned 80 / afterChange 80 before, and aligned 20 / afterChange 20 after. Rendering and schema imports are stubbed in that fixture. No full Jest suite or browser drag matrix was run.

Focused source-method proof

Manual reproduction:

<a-slider :default-value="80" :step="null" :marks="{0:'0',20:'20',80:'80',100:'100'}" :max="max" @afterChange="committed=$event" />

Hold the thumb, change max from 100 to 60, and release. The nearest valid remaining mark is 20.

Changelog description

Slider ignores stale marks outside updated bounds when committing a value.

Self check before merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant