UI: added workaround for matChipInputAddOnBlur selection bug in tb-entity-subtype-list input
This commit is contained in:
parent
2fb9b74bae
commit
937124fa61
@ -31,9 +31,10 @@
|
||||
style="max-width: 200px;"
|
||||
#entitySubtypeInput
|
||||
(focusin)="onFocus()"
|
||||
(blur)="addOnBlur($event)"
|
||||
formControlName="entitySubtype"
|
||||
matAutocompleteOrigin
|
||||
matChipInputAddOnBlur
|
||||
matChipInputAddOnBlur="false"
|
||||
#origin="matAutocompleteOrigin"
|
||||
[matAutocompleteConnectedTo]="origin"
|
||||
[matAutocomplete]="entitySubtypeAutocomplete"
|
||||
|
||||
@ -262,6 +262,15 @@ export class EntitySubTypeListComponent implements ControlValueAccessor, OnInit,
|
||||
this.clear('');
|
||||
}
|
||||
}
|
||||
|
||||
addOnBlur(event: FocusEvent) {
|
||||
if (!event.relatedTarget) {
|
||||
return;
|
||||
}
|
||||
const value = this.entitySubtypeInput.nativeElement.value;
|
||||
this.chipAdd({value} as MatChipInputEvent);
|
||||
}
|
||||
|
||||
remove(entitySubtype: string) {
|
||||
const index = this.entitySubtypeList.indexOf(entitySubtype);
|
||||
if (index >= 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user