angular / angular/components

(feat) Chips: validation for chips

Ouverte
#8,801 9 commentaires 24 réactions 0 personnes assignées Voir sur GitHub
area: material/chips feature forms G P2
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### 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?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction Plunker ou StackBlitz liée et suivez la mat-chip-list dans mat-form-field, y compris l’input imbriqué et la liaison du formulaire. Le travail est considéré comme terminé lorsque les validateurs personnalisés et mat-error fonctionnent à la fois pour la saisie de chips et pour l’ensemble de la chip-list, les ajouts étant répercutés via ngModel et l’API de validation.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.