JBAS-2567 Combobox asyncSupportsEmptyTermClick fix
authorBill Erickson <berickxx@gmail.com>
Fri, 4 Dec 2020 16:17:51 +0000 (11:17 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 2 Jun 2021 22:20:27 +0000 (18:20 -0400)
Fixes situation where combobox would fetch the needed entries in async
mode, but fail to open the drop-down.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts

index 5024189..ba3cc95 100644 (file)
@@ -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,10 +496,8 @@ 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_') { term = ''; }
 
                 // Filter entrylist whose labels substring-match the
                 // text entered.