Skip to content

[Input Group] Valid state shown for a field with no rules after switching [formField] #17619

Description

@viktorkombov

Description

With Signal Forms, after [formField] is switched from a field that was invalid to a field with no rules, igxInput shows the VALID success state. The input remembers that the previous field had rules. Found in #17556, which adds the Signal Forms support.

Framework

Angular

Angular Version

22.1.x

Ignite UI for Angular Version

22.2.x (PR #17556)

Component / Area

Input Group

Browser

Chrome

Operating System

Windows

Command Not Working

No response

Steps to Reproduce

  1. Check out branch rkaraivanov/fix-17556.
  2. Add the following to a dev sample:
public plain = signal(false);
public model = signal({ validated: '', plain: 'anything' });
public userForm = form(this.model, p => {
    validate(p.validated, ({ value }) => value().length >= 3 ? undefined : { kind: 'short' });
});
<igx-input-group>
    <input igxInput [formField]="plain() ? userForm.plain : userForm.validated" />
</igx-input-group>
  1. Run the sample. The input is bound to validated, which starts invalid.
  2. Set plain to true, so the input is bound to plain, which has no rules.
  3. Focus the input and mark userForm.plain as touched.

Actual Result

The input is in the VALID state.

Expected Result

The input is in the INITIAL state, the same as when it is bound to plain from the start.

Reproduction URL

#17556

Attachments

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugAny issue that describes a bug✅ status: resolvedApplies to issues that have pending PRs resolving them, or PRs that have already merged.input-groupversion: 22.2.x

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions