Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kaspertygesen opened this issue May 24, 2017 · 1 comment · Fixed by #4797
Closed

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

kaspertygesen opened this issue May 24, 2017 · 1 comment · Fixed by #4797
Assignees

Comments

@kaspertygesen
Copy link

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

@devversion devversion self-assigned this May 25, 2017
devversion added a commit to devversion/material2 that referenced this issue May 25, 2017
When setting the disabled state of a slide-toggle using the FormControl's `enable()` and `disable()` methods the slide-toggle's view won't be updated properly.

Fixes angular#4774
andrewseguin pushed a commit that referenced this issue Jun 5, 2017
When setting the disabled state of a slide-toggle using the FormControl's `enable()` and `disable()` methods the slide-toggle's view won't be updated properly.

Fixes #4774
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants