From: Galen Charlton Date: Wed, 26 Feb 2020 17:04:45 +0000 (-0500) Subject: eg-combobox: handle cases where selectedId gets cleared X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9de6fc6e6c89d633d67497e95c3af05a720c057d;p=working%2FEvergreen.git eg-combobox: handle cases where selectedId gets cleared Signed-off-by: Galen Charlton --- 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 dbe17aa6df..c52efe3212 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 @@ -268,6 +268,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 @@ -277,8 +282,8 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie this.asyncIds = {}; this.entrylist.length = 0; this.selected = null; + this.ngOnInit(); } - this.ngOnInit(); } }