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
- Check out branch
rkaraivanov/fix-17556.
- 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>
- Run the sample. The input is bound to
validated, which starts invalid.
- Set
plain to true, so the input is bound to plain, which has no rules.
- 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
Description
With Signal Forms, after
[formField]is switched from a field that was invalid to a field with no rules,igxInputshows theVALIDsuccess 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
rkaraivanov/fix-17556.validated, which starts invalid.plaintotrue, so the input is bound toplain, which has no rules.userForm.plainas touched.Actual Result
The input is in the
VALIDstate.Expected Result
The input is in the
INITIALstate, the same as when it is bound toplainfrom the start.Reproduction URL
#17556
Attachments
No response