From 34acb501f006a4ed4425e1492ca4efc71c4f5ff4 Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Thu, 14 Sep 2023 16:38:20 +0200 Subject: [PATCH] fix(dropdown): create label before changing value as in 2.8.8 This PR reverts the order change of add.value and add.label introduced in #1854 There was no reason doing so. But this change now had an impact when trying to access the labels inside the onchange callback as the (new) labels are now not available yet when onChange is called (as it was unil 2.8.8) --- src/definitions/modules/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 67554ee120..5c0576f7a4 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -2806,8 +2806,8 @@ module.save.remoteData(selectedText, selectedValue); } if (settings.useLabels) { - module.add.value(selectedValue, selectedText, $selected, preventChangeTrigger); module.add.label(selectedValue, selectedText, shouldAnimate); + module.add.value(selectedValue, selectedText, $selected, preventChangeTrigger); module.set.activeItem($selected); module.filterActive(); module.select.nextAvailable($selectedItem);