Browse Source

UI: Use explicit null check in onOptionSelected to handle falsy values

Truthiness check on event.option.value would incorrectly route to
clear() for valid falsy values like 0 or "". Use != null instead.
pull/15273/head
Vladyslav_Prykhodko 2 months ago
parent
commit
93bc81e5b8
  1. 2
      ui-ngx/src/app/shared/components/string-items-list.component.ts

2
ui-ngx/src/app/shared/components/string-items-list.component.ts

@ -208,7 +208,7 @@ export class StringItemsListComponent implements ControlValueAccessor, OnInit {
}
onOptionSelected(event: MatAutocompleteSelectedEvent): void {
if (event.option.value) {
if (event.option.value != null) {
this.add(event.option.value);
} else {
this.clear();

Loading…
Cancel
Save