From 425aaf5f8371bb903d4eeae6e44737f02b59f18b Mon Sep 17 00:00:00 2001 From: sakarora Date: Thu, 4 Apr 2024 11:23:02 +0530 Subject: [PATCH] FORMS-13829 Drop Down View not getting updated, even if model is updated. --- .../dropdown/v1/dropdown/clientlibs/site/js/dropdownview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/dropdown/v1/dropdown/clientlibs/site/js/dropdownview.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/dropdown/v1/dropdown/clientlibs/site/js/dropdownview.js index 3c3e57e686..9dc2305ab4 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/dropdown/v1/dropdown/clientlibs/site/js/dropdownview.js +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/dropdown/v1/dropdown/clientlibs/site/js/dropdownview.js @@ -117,10 +117,10 @@ } let isMultiSelect = this._model.isArrayType(); [...this.widget].forEach((option) => { + // clear of any selection, and re-add selection (otherwise HTML shows stale state if it already existed) + option.removeAttribute('selected'); if(this.#checkIfEqual(value, option.value, isMultiSelect)) { option.setAttribute('selected', 'selected'); - } else { - option.removeAttribute('selected'); } }); super.updateEmptyStatus();