Skip to content

bug(mat-slider): ignores first press if value is bigger than max #23817

Closed
@mkhodan

Description

@mkhodan

Reproduction

I created a simple demo to demonstrate the issue. There are an input and mat-slider(min: 0, max: 100, step: 20). Initial value is 40. When I input a value that is bigger than sliders max value and try to decrease it with keyboard(by switching to it with tab and pressing Left Arrow) it ignores my first click(In fact I guess it just aligns value to max).

Steps to reproduce:

  1. open stackblitz
  2. in the input type 120
  3. press tab
  4. press Arrow Left
  5. press Arrow Left Again

Expected Behavior

Value is decreased after each Arrow press

Actual Behavior

Value is changed only after second Arrow press, first click is ignored if input value is bigger than max value(which is 100)

Environment

  • Angular 12.2.9:
  • CDK/Material 12.2.9:
  • Browser(s): Chrome 95.0.4638.54 (Official Build) (64-bit)
  • Operating System (Reproducible both on Windows and Mac):

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/slider

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions