Skip to content

Radio CVA has wrong behavior with callSetDisabledState = 'whenDisabledForLegacyCode' #53240

Closed as not planned

Description

@m-akinc

Which @angular/* package(s) are the source of the bug?

forms

Is this a regression?

No

Description

Angular v15 fixed a long-standing bug related to setDisabledState not always being called. The fix was a breaking change, so a configuration option, callSetDisabledState, was also introduced to provide a way to opt into the old, "legacy" behavior. The bug fix also caused a problem for radio buttons that was subsequently fixed by making the radio CVA default to using the "legacy" behavior. However, if you use the configuration option to opt into the legacy behavior (i.e. callSetDisabledState = 'whenDisabledForLegacyMode'), the radio CVA uses the non-legacy behavior. Here is a visual matrix of the scenarios:
image
This does not make sense. There is no reason that using 'whenDisabledForLegacyMode' should make the radio CVA use a non-legacy, problematic behavior.

The code is straightforward. It should just not include || callSetDisabledState === 'whenDisabledForLegacyMode' in the condition.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

Activity

  1. added this to the needsTriage milestone on Nov 29, 2023
  2. Achilles1515 commented on Jan 18, 2024

    @Achilles1515
  3. changed the title [-]Radio CVA has wrong behavior with callSetDisabledState = 'whenDisabledForLegacyMode'[/-] [+]Radio CVA has wrong behavior with callSetDisabledState = 'whenDisabledForLegacyCode'[/+] on Oct 17, 2025
  4. arturovt commented on Sep 29, 2026

    @arturovt
    Contributor

    @JeanMeche this can be closed. No upvotes, no reproduction, and needsTriage since 2023.

    The clause the report asks to remove is the one that keeps [attr.disabled] working on radios, and it guards exactly the mode Google runs on internally, so removing it is a behavior change with a wide blast radius for a case nobody has reported hitting. In practice the clause is also close to redundant: in whenDisabledForLegacyCode mode setDisabledState is only called when the control is disabled, so isDisabled already satisfies the condition.

    New work here is going into signal forms rather than the legacy CVAs.

  5. JeanMeche commented on Oct 29, 2026

    @JeanMeche
    Member

    Without additional reports since the initial report and with the focus now on Signal forms, we won't be addressing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions