Skip to content

bug(mat-slider): value updated on slide #26496

Closed
@angelaki

Description

@angelaki

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

14

Description

When sliding, the value is updated several times on sliding now. The old version seamed to just update to value on dragStop. Being able to control this behavior would be nice, since min & max cannot depend on value right now:

<mat-slider class="flex-auto" discrete [min]="(value??1)-.01"
[max]="(value??1)+.01" [step]="0.0001">
<input matSliderThumb [(value)]="value">

Used to work. Now it produces weird results.

Reproduction

Working with Angular Material 14:
https://stackblitz.com/edit/angular-ivy-tjgb4z?file=src/app/app.component.html

Broken with Angular Material 15:
https://stackblitz.com/edit/angular-ivy-i6jdmt?file=src/app/app.component.html

Expected Behavior

After setting a new value the slider gets centered and new limits are set. If the value update now changed I'd like to control the moment of update.

Actual Behavior

The limits change continously while sliding and the slider gets useless.

Environment

  • Angular: 15
  • CDK/Material: 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: material/sliderneeds: clarificationThe issue does not contain enough information for the team to determine if it is a real bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions