LP1929741 Combobox supports startsWith search (p2)
authorBill Erickson <berickxx@gmail.com>
Tue, 22 Jun 2021 18:46:51 +0000 (14:46 -0400)
committerJane Sandberg <js7389@princeton.edu>
Sun, 2 Oct 2022 15:02:49 +0000 (08:02 -0700)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts

index b34cf1b..50cc70f 100644 (file)
@@ -279,7 +279,11 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie
                     args = this.idlBaseQuery;
                 }
                 const extra_args = { order_by : {} };
-                args[field] = {'ilike': `%${term}%`}; // could -or search on label
+                if (this.startsWith) {
+                    args[field] = {'ilike': `${term}%`};
+                } else {
+                    args[field] = {'ilike': `%${term}%`}; // could -or search on label
+                }
                 if (this.idlQueryAnd) {
                     Object.assign(args, this.idlQueryAnd);
                 }