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;"
|
style="max-width: 200px;"
|
||||||
#entitySubtypeInput
|
#entitySubtypeInput
|
||||||
(focusin)="onFocus()"
|
(focusin)="onFocus()"
|
||||||
|
(blur)="addOnBlur($event)"
|
||||||
formControlName="entitySubtype"
|
formControlName="entitySubtype"
|
||||||
matAutocompleteOrigin
|
matAutocompleteOrigin
|
||||||
matChipInputAddOnBlur
|
matChipInputAddOnBlur="false"
|
||||||
#origin="matAutocompleteOrigin"
|
#origin="matAutocompleteOrigin"
|
||||||
[matAutocompleteConnectedTo]="origin"
|
[matAutocompleteConnectedTo]="origin"
|
||||||
[matAutocomplete]="entitySubtypeAutocomplete"
|
[matAutocomplete]="entitySubtypeAutocomplete"
|
||||||
|
|||||||
@ -262,6 +262,15 @@ export class EntitySubTypeListComponent implements ControlValueAccessor, OnInit,
|
|||||||
this.clear('');
|
this.clear('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addOnBlur(event: FocusEvent) {
|
||||||
|
if (!event.relatedTarget) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const value = this.entitySubtypeInput.nativeElement.value;
|
||||||
|
this.chipAdd({value} as MatChipInputEvent);
|
||||||
|
}
|
||||||
|
|
||||||
remove(entitySubtype: string) {
|
remove(entitySubtype: string) {
|
||||||
const index = this.entitySubtypeList.indexOf(entitySubtype);
|
const index = this.entitySubtypeList.indexOf(entitySubtype);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user