-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(examples): fix form-field custom control disabled
input
#14957
fix(examples): fix form-field custom control disabled
input
#14957
Conversation
* fixes form-field custom control example and guide so as not to attempt to use the `disabled` attribute on an input element that has a reactive form directive. see: https://github.com/angular/angular/blob/e2c98fbe11272295c3827b0e54f859d283cd32bf/packages/forms/src/directives/reactive_errors.ts#L64
get disabled(): boolean { return this._disabled; } | ||
set disabled(value: boolean) { | ||
this._disabled = coerceBooleanProperty(value); | ||
this._disabled ? this.parts.disable() : this.parts.enable(); |
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.
Should this be added to the final result in form-field-custom-control-example.ts
as well?
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.
@crisbeto Yes, this PR amends the guide and example to match. Thanks
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.
Ah, I must've missed it the first time around.
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
get disabled(): boolean { return this._disabled; } | ||
set disabled(value: boolean) { | ||
this._disabled = coerceBooleanProperty(value); | ||
this._disabled ? this.parts.disable() : this.parts.enable(); |
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.
Ah, I must've missed it the first time around.
* fixes form-field custom control example and guide so as not to attempt to use the `disabled` attribute on an input element that has a reactive form directive. see: https://github.com/angular/angular/blob/e2c98fbe11272295c3827b0e54f859d283cd32bf/packages/forms/src/directives/reactive_errors.ts#L64
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. |
to use the
disabled
attribute on an input element that has a reactiveform directive. see: https://github.com/angular/angular/blob/e2c98fbe11272295c3827b0e54f859d283cd32bf/packages/forms/src/directives/reactive_errors.ts#L64