Skip to content

bug(mat-slider): Incorrect slider thumb position when changing min/ max and form value #32521

@shirley543

Description

@shirley543

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

A range slider is bound to a reactive form using formControlName; min/ max properties are also bound.
After programmatically updating min/ max variables and calling setValue to update the form values, observed behaviour is that range slider thumbs don't match the form values. Expected behaviour is that thumb positions match the calls to setValue.

slider-thumb-mismatch.mp4

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-xwmbwzkn?file=src%2Fmain.ts
Steps to reproduce:

  1. Select Category A (this sets ranges to be [10, 20] + [20, 30], and absolute min/ max to be [10, 30])
  2. Select Category B (this sets ranges to be [5, 15] + [15, 25], and absolute min/ max to be [5, 25])
  3. Hover over 1st slider's thumbs

Expected Behavior

Expected slider 1's thumbs to be at [5, 15] (to match form values after having called setValue)

Actual Behavior

Observed slider 1's thumbs to be at [10, 15] (which doesn't match form values)

Environment

  • Angular: 20.3.15
  • CDK/Material: 20.2.14
  • Browser(s): Chrome Version 143.0.7499.41 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions