Skip to content

After enable() slide toggles sometimes remain partially disabled #4774

Closed
@kaspertygesen

Description

@kaspertygesen

Bug, feature request, or proposal:

Bug

What is the expected behavior?

You should be able to enable a disabled slide toggle so that the user can both drag and click the slide toggle to change its value.

What is the current behavior?

If a slide toggle is initialized as disabled or if the slide toggle is clicked while disabled, then a "disabled"-attribute is set on the element.
The "disabled"-attribute doesn't get removed when the slide toggle is enabled using the enable() function. The "mat-disabled"-class is added and removed as expected.
The "disabled"-attribute also doesn't get set after a disable() function call.

While the "disabled"-attribute is set on the element, the user can't click the slide toggle to change the value.
Dragging the slide toggle changes the value and removes the "disabled"-attribute.

What are the steps to reproduce?

Try to enable the second slide toggle by changing the value of the first.
It isn't possible to change the value by clicking the slide toggle or the label.

http://plnkr.co/edit/rs1YsefeDTB5UZpJ9H6L?p=preview

What is the use-case or motivation for changing an existing behavior?

Desktop users may not find it natural that they have to drag the slide toggle with the mouse to change the value in this scenario.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 4, Material master & beta5, 2.2, Chrome

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions