bug(chips-input) NO error state !
See original GitHub issueBug, feature request, or proposal:
Bug
<form [formGroup]='group'>
<mat-form-field class="example-chip-list">
<mat-chip-list #chipList>
<mat-chip *ngFor="let fruit of fruits" [selectable]="selectable"
[removable]="removable" (removed)="remove(fruit)">
{{fruit.name}}
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
</mat-chip>
<!-- add formContorlName 'newFruit' -->
<input placeholder="New fruit..."
formContorlName='newFruit'
[matChipInputFor]="chipList"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
[matChipInputAddOnBlur]="addOnBlur"
(matChipInputTokenEnd)="add($event)">
</mat-chip-list>
<!-- add mat-error -->
<mat-error *ngIf="group.controls.newFruit.hasError('required')">required!</mat-error>
</mat-form-field>
</form>
What is the expected behavior?
In this case, it can display error!
What is the current behavior?
If input is empty, no error will be displayed.
What are the steps to reproduce?
https://stackblitz.com/angular/pxxkxklrgaqg?file=app%2Fchips-input-example.html You can try it on your example…
What is the use-case or motivation for changing an existing behavior?
Displaying error prompts when errors occur
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
All latest
Is there anything else we should know?
No.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Angular Matchiplist With Error Message (forked) - StackBlitz
Chips with input with error message. ... errorState">Too many chips</mat-error>. <mat-hint>Can only contain 3 chips max</. mat-hint>. </mat-form-field>.
Read more >Angular material mat-chip-list with input not showing ...
Problem: When I remove all the elements from the input field, the parent form (formGroup) is marked as invalid but the error property...
Read more >flutter_chips_input | Flutter Package - Pub.dev
Fixed bug where FocusNode was not being properly disposed; Applied pedantic rules and ... Resolve overlay assertion error '_overlay != null': is not...
Read more >Flutter - Custom Form Field - Chip Input (No Extra Libs)
The video goes over how to create a Custom FormField in Flutter. Specifically, I am focusing on a chip input type field.
Read more >ngx-chips - npm
Tag Input Component for Angular Build Status npm version ... Notice: the latest version on NPM may not reflect the branch master ....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing as the form control should actually go onto the
MatChipList
since the list is what shows all of the control values.You can see a fork of the stackblitz here in which if all of the chips are removed will show an error for required.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.