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
fix(forms): always call setDisabledState
, not just when the control is disabled
#47576
Conversation
3c57a3e
to
f54323c
Compare
f54323c
to
bd754a3
Compare
82f6605
to
f6f5e07
Compare
f6f5e07
to
85ead29
Compare
64f2e6a
to
10cdf83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor comments below. Thank you.
The components breakage has now been fixed in angular/components#25790 |
merge-assistance: wait for CI to finish, then submit this together with g3 local mod |
…trol is enabled Previously, `setDisabledState` was never called when attached if the control is enabled. This PR fixes the bug, and creates a configuration option to opt-out of the fix. Fixes angular#35309. BREAKING CHANGE: setDisabledState will always be called when a `ControlValueAccessor` is attached. You can opt-out with `FormsModule.withConfig` or `ReactiveFormsModule.withConfig`.
bea364e
to
6ab382e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for dev-infra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: size-tracking
This PR was merged into the repository by commit 96b7fe9. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When a CVA is added to a form, reactive forms should always call the setDisabledState method, not just when it's disabled.
This PR provides an option in the forms module config to opt-out, since it's a breaking change. We will likely use that option inside of g3 if too many tests are broken.
Fixes #35309.