Browse Source
Merge pull request #10173 from Dmitriymush/bug-fix/tb-entity-subtype-list
Added workaround for matChipInputAddOnBlur selection bug in tb-entity-subtype-list input
pull/10271/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
1 deletions
-
ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.html
-
ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.ts
|
|
|
@ -31,9 +31,9 @@ |
|
|
|
style="max-width: 200px;" |
|
|
|
#entitySubtypeInput |
|
|
|
(focusin)="onFocus()" |
|
|
|
(blur)="addOnBlur($event)" |
|
|
|
formControlName="entitySubtype" |
|
|
|
matAutocompleteOrigin |
|
|
|
matChipInputAddOnBlur |
|
|
|
#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) { |
|
|
|
|