Skip to content

Commit

Permalink
fix(dropdown): create label before changing value as in 2.8.8
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
lubber-de authored Sep 14, 2023
1 parent 9e5d2f7 commit 34acb50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 34acb50

Please sign in to comment.