I have an input where user can search a chip and return a matched chip when they pressed enter but I'm wondering how I can make the input to return always lower case after enter is pressed since some time it look like a user can create two different chips, one with upercase and one with lowercase even though it will store only in lowercase.
For example right now,
User enter "CHART" with upper case -> it create "CHART" chip -> after browser is refresh, it show in lowercase "chart"
User enter "chart" with lowercase-> it create "chart" chip -> after browser is refresh, it show in lowercase "chart"
Also if a user create chip with uppercase first, it seem like they can create the same chip multiple time but if they create with lowercase first the input stop the user from creating the same chip multiple time and that is what I want.
TRYING TO DO
I just want to create only one chip if the user enter either with lowercase or uppercase and prevent if they try to create the same chips again either with uppercase or lowercase.
HTML
<input matInput #input [(ngModel)]="tagIn" (ngModelChange)="tagIn = $event.toLowerCase()" [formControl]="tagCtrl" [matAutocomplete]="auto" [matChipInputFor]="chipList"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes" (matChipInputTokenEnd)="add($event,null)">
</div>
This is exactly look like my project https://stackblitz.com/edit/angular-occkra but also have the same problem, user can create multiple tags with the same word like "Apple" 'APPLE" "ApPLe" instead of just one.