You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warning regarding "disabled" property of [formControl] family of directives refers to behavior thats specific to a subset of ControlValueAccessors, but shows up for all of them #57793
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
No
Description
I have a custom component implementing ControlValueAccessor that wraps around native <input type="radio" /> so that I can provide more custom design, which is a common task. Radio buttons of a group work with same formControl instance with the way things are implemented in my case. The inner <input type="radio" /> does NOT use RadioControlValueAccessor.
I let my custom component have 'disabled' Input and I do document that when this input is disabled=true then that takes precedence over the status of the form control (that it gets provided through [formControl], [formControlName], etc...), otherwise form control status is the one in effect. This works just fine for selectively disabling single radio buttons, yet, I get the warning from
It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true
when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
you. We recommend using this approach to avoid 'changed after checked' errors.
But thats not true, because that effect may not happen for ControlValueAccessors that are implemented outside Angular, unlike eg.: RadioControlValueAccessor, see
But thats not the accessor I am using anywhere in my code, so this warning still shows up, even though its not related to my usecase, where the behavior is well documented.
So now I have to:
Be stuck with the warning, even though its false positive
Use a different name other than "disabled"
Could the warning be moved away from [formControl] directives, to the subclasses of BuiltInControlValueAccessor that actually do the disabled prop writing behavior instead?
Please provide a link to a minimal reproduction of the bug
Activity
Erbenos commentedon Sep 18, 2024
Updated the original description with a very simple repro case.
JeanMeche commentedon Oct 29, 2026
This is basically a directive matching issue. The disabled input is both used for your custom component and the FormGroupDirective.
You will encounter a similar issue with signal forms, because disabled is handled at the form level, not in the UI.
In both cases you shouldn't be passing the disabled status via an input, but via the control structure.