primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.58k stars 4.61k forks source link

Component: Chips - Component not marking form control as touched when a new item is added #12686

Open timandella opened 1 year ago

timandella commented 1 year ago

Describe the bug

When the Chips component is linked to a Reactive form, then when the user types in some text and presses Enter to add a new chip, even though the form control associated with the component is marked as dirty, it is not marked as touched.

I feel it should be marked as touched in this instance because the form is actually updated at this point, and any validation should be shown.

Environment

Windows 10

Reproducer

https://stackblitz.com/edit/github-udq5js?file=src/app/app.component.html

Angular version

15.0.0

PrimeNG version

15.0.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.15.1

Browser(s)

No response

Steps to reproduce the behavior

  1. Create a component in which the Chips component is linked to a reactive form
  2. Enter some text in the Chips component and press Enter

Expected behavior

Form control should be marked as touched

volvachev commented 1 year ago

Hi, i think you not right (check official doc). Right now it works on the blur event.

timandella commented 1 year ago

Yes, it works on the blur event, but I am suggesting that for the Chips component, when the user enters some text and pressed Enter to add a new chip, the component should also be marked as touched then.