diff --git a/packages/core/src/render3/instructions/control.ts b/packages/core/src/render3/instructions/control.ts index 352155c4786..a1f75a78254 100644 --- a/packages/core/src/render3/instructions/control.ts +++ b/packages/core/src/render3/instructions/control.ts @@ -294,7 +294,6 @@ function listenToNativeControl(lView: LView<{} | null>, tNode: TNode, control: ); const blurListener = () => { - // TODO: https://github.com/orgs/angular/projects/60/views/1?pane=issue&itemId=131860538 control.state().markAsTouched(); }; listenToDomEvent( diff --git a/packages/forms/signals/test/web/field_directive.spec.ts b/packages/forms/signals/test/web/field_directive.spec.ts index e6049cca9b7..48e0619a76f 100644 --- a/packages/forms/signals/test/web/field_directive.spec.ts +++ b/packages/forms/signals/test/web/field_directive.spec.ts @@ -994,6 +994,28 @@ describe('field directive', () => { ]); }); + it(`should mark field as touched on native control 'blur' event`, () => { + @Component({ + imports: [Field], + template: ``, + }) + class TestCmp { + f = form(signal('')); + } + + const fixture = act(() => TestBed.createComponent(TestCmp)); + const input = fixture.nativeElement.firstChild as HTMLInputElement; + const field = fixture.componentInstance.f; + + expect(field().touched()).toBe(false); + + act(() => { + input.dispatchEvent(new Event('blur')); + }); + + expect(field().touched()).toBe(true); + }); + it('should synchronize with custom control touched status', () => { @Component({ selector: 'my-input',