From 1b70eb2e1737c2d98d5616724381405c6dbb6ad9 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 4 Dec 2020 11:17:51 -0500 Subject: [PATCH] LP#1904244: combobox: asyncSupportsEmptyTermClick fix Fixes situation where combobox would fetch the needed entries in async mode, but fail to open the drop-down. This includes code originally written by Bill Erickson with additions by Galen Charlton to insure that static data sources would continue to work. Signed-off-by: Galen Charlton Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson --- .../src/eg2/src/app/share/combobox/combobox.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 50241894e5..3d3939862f 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 @@ -466,7 +466,7 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie (entry: ComboboxEntry) => this.addAsyncEntry(entry), err => {}, () => { - observer.next(searchTerm); + observer.next(term); observer.complete(); } ); @@ -496,9 +496,13 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie // click action occurred. if (term === '') { return []; } - // In sync-data mode, a click displays the full list. - if (term === '_CLICK_' && !this.asyncDataSource) { - return this.entrylist; + // Clicking always displays the full list. + if (term === '_CLICK_') { + if (this.asyncDataSource) { + term = ''; + } else { + return this.entrylist; + } } // Filter entrylist whose labels substring-match the -- 2.11.0