Skip to content

fix(forms): not picking up disabled state if group is swapped out and disabled - #43499

Closed
crisbeto wants to merge 2 commits into
angular:masterfrom
crisbeto:22556/forms-disabled-state
Closed

crisbeto wants to merge 2 commits into
angular:masterfrom
crisbeto:22556/forms-disabled-state

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Fixes a long-standing issue where swapping out the FormGroup and calling disable immediately afterwards doesn't actually disable the ControlValueAccessor.

Fixes #22556.

@google-cla google-cla Bot added the cla: yes label Sep 18, 2021
@crisbeto
crisbeto force-pushed the 22556/forms-disabled-state branch 3 times, most recently from 28ed1e0 to f07d48f Compare September 18, 2021 11:05
Comment thread packages/forms/src/directives/shared.ts Resolved
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer area: forms target: patch This PR is targeted for the next patch release labels Sep 18, 2021
@ngbot ngbot Bot modified the milestone: Backlog Sep 18, 2021
@crisbeto
crisbeto marked this pull request as ready for review September 18, 2021 11:28
@ngbot ngbot Bot added this to the Backlog milestone Sep 18, 2021
@pullapprove
pullapprove Bot requested a review from AndrewKushnir September 18, 2021 11:29
@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Sep 21, 2021
@AndrewKushnir

AndrewKushnir commented Sep 21, 2021 •

Copy link
Copy Markdown
Contributor

Presubmit (internal-only link) to gather some data as requested in #43499 (comment).
Also, I've started a global presubmit (internal-only link).

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crisbeto I've just left one comment about another directive that would need an update. Please have a look when you get a chance.

I've also got some news after running a global presubmit. You were correct, the change is not as break-y as #35311 and there was just 1 failing target that would require investigation/cleanup. We'll provide more info after initial investigation.

// cc @dylhunn

@dylhunn

dylhunn commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

I'll have a look at this later this afternoon, sorry I didn't see the mention yesterday!

… disabled

Fixes a long-standing issue where swapping out the `FormGroup` and calling `disable` immediately afterwards doesn't actually disable the `ControlValueAccessor`.

Fixes angular#22556.
@crisbeto
crisbeto force-pushed the 22556/forms-disabled-state branch from f07d48f to 9bf293e Compare September 22, 2021 04:44
@dylhunn

dylhunn commented Sep 22, 2021

Copy link
Copy Markdown
Contributor

@AndrewKushnir Do you have a link to the failing target from the TGP?

@AndrewKushnir

AndrewKushnir commented Sep 22, 2021 •

Copy link
Copy Markdown
Contributor

Do you have a link to the failing target from the TGP?

@dylhunn yes, see #43499 (comment).

@dylhunn

dylhunn commented Sep 24, 2021

Copy link
Copy Markdown
Contributor

I had some difficulty understanding why this breaks the failing target, unfortunately. I will allocate some more time to try to figure it out on Monday. Sorry I don't have an answer yet.

@AndrewKushnir AndrewKushnir assigned crisbeto and unassigned dylhunn Oct 15, 2021
@AndrewKushnir AndrewKushnir added state: blocked and removed action: presubmit The PR is in need of a google3 presubmit labels Oct 29, 2021
@dylhunn

dylhunn commented Nov 30, 2021

Copy link
Copy Markdown
Contributor

@crisbeto Since you're a Googler now, do you want to take over the presubmit on this? Sorry I let it drag for so long.

@crisbeto

Copy link
Copy Markdown
Member Author

Sure, I ran a presubmit for it some time ago, but I haven't had the time to investigate it either.

@dylhunn
dylhunn removed their request for review December 1, 2021 22:53
@dylhunn dylhunn added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 1, 2021
@wawyed

wawyed commented Mar 9, 2022

Copy link
Copy Markdown

Could we have some progress on this?

@dylhunn

dylhunn commented Mar 25, 2022 •

Copy link
Copy Markdown
Contributor

This is sort of a half-fix, as @crisbeto described: it fixes the issue if an enabled control is swapped for a disabled one, but not vice versa.

However, this "half" of the fix by far the more impactful half, and it should be a lot less breaking. I think we should merge this for v14 if the breakage isn't too bad. I'll check back tomorrow and assess the fresh TGP.

@dylhunn

dylhunn commented Mar 25, 2022 •

Copy link
Copy Markdown
Contributor

I ran a fresh TGP, and there is only one failing target in all of google3. It looks like it should be easy to fix, and then I think we can just merge this. I will have a look later today.

@dylhunn dylhunn added target: major This PR is targeted for the next major release and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews target: patch This PR is targeted for the next patch release labels Mar 25, 2022
@dylhunn
dylhunn self-requested a review March 25, 2022 20:47

@dylhunn dylhunn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-forms

@dylhunn

dylhunn commented Mar 25, 2022

Copy link
Copy Markdown
Contributor

Merge is blocked on cl/437323972

@dylhunn

dylhunn commented Mar 28, 2022

Copy link
Copy Markdown
Contributor

The g3 fix has been merged.

@dylhunn dylhunn added action: merge The PR is ready for merge by the caretaker and removed state: blocked labels Mar 28, 2022
@dylhunn

dylhunn commented Mar 28, 2022

Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit b36dec6.

@dylhunn dylhunn closed this in b36dec6 Mar 28, 2022
josmar-crwdstffng pushed a commit to josmar-crwdstffng/angular that referenced this pull request Apr 8, 2022
… disabled (angular#43499)

Fixes a long-standing issue where swapping out the `FormGroup` and calling `disable` immediately afterwards doesn't actually disable the `ControlValueAccessor`.

Fixes angular#22556.

PR Close angular#43499
@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 Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: forms cla: yes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

formGroup disable()/enable() does not work right after init

5 participants