Follow-up to LP#
1850547: Avoid clearing the selected item in the
combobox when selectedId is set to null in cases where freetext is
enabled and a freetext value is present.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
if (!firstTime) {
if ('selectedId' in changes) {
if (!changes.selectedId.currentValue) {
- this.selected = null;
+
+ // In allowFreeText mode, selectedId will be null even
+ // though a freetext value may be present in the combobox.
+ if (this.allowFreeText) {
+ if (this.selected && !this.selected.freetext) {
+ this.selected = null;
+ }
+ } else {
+ this.selected = null;
+ }
}
}
if ('idlClass' in changes) {