-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(forms): disabled controls should never be invalid #11257
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
Conversation
@mprobst this one lgtm |
Is it somehow related to the case, when I disable all invalid controls form becomes valid as expected, but if I call |
Will this also fix the case that calling I made a simple plnkr for that: |
@rgripper Yes, the PR fixes that issue. If you npm install from the nightly build ( @capi The way the model works is that a parent form group is disabled if all its child controls are disabled. The status of group controls is always calculated as a reduction of the child controls. In your example, your form only has one form control. Once you disable it, you are effectively disabling the whole form because all its children are disabled. If you log the status of the form, you'll see that its status is 'DISABLED', which is why valid is false. The statuses are mutually exclusive. |
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. |
We were running the disabled check too late, so sometimes individual controls that were instantiated as invalid and disabled were mistakenly calculated to be 'invalid'. The disabled status should always trump any other status.