From efc1b1a69977215c5dbc50a112c51ef1e9e6f6ce Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 8 Jun 2020 16:03:14 -0400 Subject: [PATCH] LP1882591 Empty combobox avoids default selection When clearing a combobox value, no combobox options are displayed in the dropdown. This allows users to clear the value then tab out of the box without the typeahead magic forcing selection of the first entry. The full list can still be displayed by clicking on the combobox. Signed-off-by: Bill Erickson --- .../src/eg2/src/app/share/combobox/combobox.component.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts index 41d2b30cec..5e2f407bce 100644 --- a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts +++ b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts @@ -376,12 +376,13 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit { mergeMap(term => this.addAsyncEntries(term)), map((term: string) => { - if (term === '' || term === '_CLICK_') { - if (!this.asyncDataSource) { - // In sync mode, a post-focus empty search or - // click event displays the whole list. - return this.entrylist; - } + // Display no values when the input is empty and no + // click action occurred. + if (term === '') { return []; } + + // In sync-data mode, a click displays the full list. + if (term === '_CLICK_' && !this.asyncDataSource) { + return this.entrylist; } // Filter entrylist whose labels substring-match the -- 2.11.0