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
parent
commit
969b845a01
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.html
  2. 9
      ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.ts

2
ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.html

@ -31,9 +31,9 @@
style="max-width: 200px;"
#entitySubtypeInput
(focusin)="onFocus()"
(blur)="addOnBlur($event)"
formControlName="entitySubtype"
matAutocompleteOrigin
matChipInputAddOnBlur
#origin="matAutocompleteOrigin"
[matAutocompleteConnectedTo]="origin"
[matAutocomplete]="entitySubtypeAutocomplete"

9
ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.ts

@ -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…
Cancel
Save