Skip to content

fix(forms): toggle disabled attribute when replacing control - #41609

Closed
ebiermann wants to merge 1 commit into
angular:masterfrom
ebiermann:form-control-enable
Closed

ebiermann wants to merge 1 commit into
angular:masterfrom
ebiermann:form-control-enable

Conversation

@ebiermann

Copy link
Copy Markdown

PR Checklist

PR Type

  • Bugfix

What is the current behavior?

When having a [formControl] directive with a disabled control and replacing it with an enabled one, the disabled flag of the corresponding DOM element is not removed. Technically ngOnChanges will only ever set the disabled state of its DOM element to true if the control is disabled instead of also removing the disabled flag if the control is enabled.

Issue Number: N/A

What is the new behavior?

When setting an enabled control as input of [formControl] the disabled attribute of its DOM element will be removed.

Does this PR introduce a breaking change?

  • No

@google-cla google-cla Bot added the cla: yes label Apr 14, 2021
@pullapprove
pullapprove Bot requested a review from AndrewKushnir April 14, 2021 05:47
When a DOM element is disabled and an enabled control is set as input of its [formControl] directive, the DOM element will not be enabled.
@ebiermann
ebiermann force-pushed the form-control-enable branch from 679b65a to f098118 Compare April 14, 2021 06:04
@ngbot ngbot Bot added this to the Backlog milestone Apr 14, 2021
@AndrewKushnir

Copy link
Copy Markdown
Contributor

Hi @ebiermann, thanks for creating this PR. It looks like it's a duplicate of the #35311. The tricky part of this change is that it requires a breaking change, so it needs more research and transition plan/mechanics for applications. I'm closing this PR in favor of #35311, please subscribe to that PR for further updates. Thank you.

@angular-automatic-lock-bot

Copy link
Copy Markdown

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 May 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants