From 9de6fc6e6c89d633d67497e95c3af05a720c057d Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 26 Feb 2020 12:04:45 -0500 Subject: [PATCH] eg-combobox: handle cases where selectedId gets cleared Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); } } -- 2.11.0