Skip to content
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

MdRadioGroup is marked "not pristine" when setValue(...) is called #1475

Closed
feloy opened this issue Oct 11, 2016 · 2 comments · Fixed by #1521
Closed

MdRadioGroup is marked "not pristine" when setValue(...) is called #1475

feloy opened this issue Oct 11, 2016 · 2 comments · Fixed by #1521
Assignees

Comments

@feloy
Copy link
Contributor

feloy commented Oct 11, 2016

Bug, feature request, or proposal:

Bug

What is the expected behavior?

In a reactive Form, when calling setValue(...) method of a formControl, the formControl should not be marked as not pristine.

What is the current behavior?

A MdRadioGroup in a reactive form is marked as not pristine when setValue(...) is called on the control form.

What are the steps to reproduce?

View github https://github.com/feloy/ng2-master-detail

  • tag bug-dirty-ok : works as expected with input radio
  • tag bug-dirty-error : does not work as expected with md-radio-button

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

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

Angular 2.0.2
Material 2.0.0-alpha.9-3
OS Linux
Browsers tested: Chrome 50, Firefox 46

Is there anything else we should know?

@feloy
Copy link
Contributor Author

feloy commented Oct 11, 2016

More details:
Here is the comment @angular/forms describing that a form control should not be marked ditry when changed programmatically:
https://github.com/angular/angular/blob/master/modules/%40angular/forms/src/model.ts#L180

I also see an error in the radio tests, where it is tested that the control should become dirty after being changed programmatically:
https://github.com/angular/material2/blob/master/src/lib/radio/radio.spec.ts#L283

@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