angular / angular/components

(feat) Chips: validation for chips

Offen
#8,801 9 Kommentare 24 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/chips feature forms G P2
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### Bug, feature request, or proposal: feature

#### What is the expected behavior?
Custom validators and `mat-error` should work when placing a chip-list inside a mat-form-field
There should be a two-fold validation: if there is a nested input for adding new chips, the input should validate entry previous to adding it.
The data of the whole chip-list should be validated.
It should work seamlessly with ngModel and validation api.

#### What is the current behavior?
The nested input cant be validated.
The form-field is bound to the chip-list control state, but the chip-list's `value` doesn't hold the whole array, but just the selected item.
It doesn't react to addition/insertions, so no validation can be trigger/shown

#### What are the steps to reproduce?
Providing a StackBlitz/Plunker (or similar) is the *best* way to get the team to see your issue.

Plunker starter (using on `@master`): https://goo.gl/uDmqyY

StackBlitz starter (using latest `npm` release): https://goo.gl/wwnhMV

#### What is the use-case or motivation for changing an existing behavior?
Use the chip-list control to edit array data in a form, and properly validate the input

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?

#### Is there anything else we should know?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der verknüpften Plunker- oder StackBlitz-Reproduktion und verfolge die mat-chip-list innerhalb von mat-form-field, einschließlich des verschachtelten input und der Formularbindung. Als abgeschlossen gilt die Aufgabe, wenn benutzerdefinierte Validatoren und mat-error sowohl für die Chipeingabe als auch für die gesamte chip-list funktionieren und Ergänzungen über ngModel und die Validierungs-API widergespiegelt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.