From: Galen Charlton Date: Wed, 26 Feb 2020 17:04:45 +0000 (-0500) Subject: LP#1850547: eg-combobox: handle cases where selectedId gets cleared X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9300b28ec0a4f63a6d0c955ba3d635f44cf17b59;p=contrib%2FConifer.git LP#1850547: eg-combobox: handle cases where selectedId gets cleared Sponsored-by: Evergreen Community Development Initiative Sponsored-by: Georgia Public Library Service Sponsored-by: Indiana State Library Sponsored-by: C/W MARS Signed-off-by: Galen Charlton Signed-off-by: Tiffany Little Signed-off-by: Bill Erickson --- 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 60ed2f7ad9..fb8b900176 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 @@ -274,6 +274,11 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie } }); if (!firstTime) { + if ('selectedId' in changes) { + if (!changes.selectedId.currentValue) { + this.selected = null; + } + } if ('idlClass' in changes) { if (!('idlField' in changes)) { // let ngOnInit reset it to the @@ -283,8 +288,8 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie this.asyncIds = {}; this.entrylist.length = 0; this.selected = null; + this.ngOnInit(); } - this.ngOnInit(); } }