We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While working on the issue I mentioned in #303 we found another Problem when creating disabled controls.
When passing a disabled control like this:
public form = createForm<MyForm>({ ..., formControls: { name: new FormControl({ value: '', disabled: true }), } });
The FormGroup that the name control is added to is being set to "enabled" because the disabled$ observable is defaulted to of(false) which causes the formGroup.enable call here: https://github.com/cloudnc/ngx-sub-form/blob/43dede0015975db59333abbc185964a15acb4262/projects/ngx-sub-form/src/lib/create-form.ts#L238C13-L238C13
FormGroup
name
disabled$
of(false)
formGroup.enable
This resets all disabled states that I initially pass to the FormControls.
FormControl
I found two workarounds:
public form = createForm<MyForm>({ ..., disabled$: new Observable<boolean>(), formControls: { name: new FormControl({ value: '', disabled: true }), } });
constructor() { this.form.formGroup.controls.name.disable(); }
This behaviour was unexpected as the new API also handles the default values via the FormControl constructors.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
While working on the issue I mentioned in #303 we found another Problem when creating disabled controls.
When passing a disabled control like this:
The
FormGroup
that thename
control is added to is being set to "enabled" because thedisabled$
observable is defaulted toof(false)
which causes theformGroup.enable
call here:https://github.com/cloudnc/ngx-sub-form/blob/43dede0015975db59333abbc185964a15acb4262/projects/ngx-sub-form/src/lib/create-form.ts#L238C13-L238C13
This resets all disabled states that I initially pass to the
FormControl
s.I found two workarounds:
disabled$
as a never emitting observable:This behaviour was unexpected as the new API also handles the default values via the
FormControl
constructors.The text was updated successfully, but these errors were encountered: