From: Bill Erickson Date: Fri, 4 Dec 2020 16:17:51 +0000 (-0500) Subject: LP1929741 Combobox asyncSupportsEmptyTermClick fix X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=00c3ac1dd81f4be250590e772deff8dd6844f5c5;p=working%2FEvergreen.git LP1929741 Combobox asyncSupportsEmptyTermClick fix Fixes situation where combobox would fetch the needed entries in async mode, but fail to open the drop-down after a click. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- 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 7df59e8ddb..a365c7eb72 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 @@ -475,12 +475,14 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie return of(term); } - let searchTerm: string; - searchTerm = term; - if (searchTerm === '_CLICK_') { + let searchTerm = term; + if (term === '_CLICK_') { if (this.asyncSupportsEmptyTermClick) { + // Search for "all", but retain and propage the _CLICK_ + // term so the filter knows to open the selector searchTerm = ''; } else { + // Skip the final filter map and display nothing. return of(); } } @@ -532,17 +534,8 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie // click action occurred. if (term === '') { return []; } - // Clicking always displays the full list. - if (term === '_CLICK_') { - if (this.asyncDataSource) { - term = ''; - } else { - // Give the typeahead a chance to open before applying - // the disabled entry styling. - setTimeout(() => this.applyDisableStyle()); - return this.entrylist; - } - } + // If we make it this far, _CLICK_ means show everything. + if (term === '_CLICK_') { term = ''; } // Give the typeahead a chance to open before applying // the disabled entry styling.