diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index dfed6b835a..b63e6ae36a 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1861,6 +1861,11 @@ return range.text.length - rangeLength; } }, + stringValue: function (value) { + return typeof value === 'object' + ? JSON.stringify(value) + : String(value); + }, value: function () { let value = $input.length > 0 ? $input.val() @@ -1929,9 +1934,10 @@ if (!$choice) { return false; } + let choiceValue = $choice.data(metadata.value); - return $choice.data(metadata.value) !== undefined - ? String($choice.data(metadata.value)) + return choiceValue !== undefined + ? module.get.stringValue(choiceValue) : (typeof choiceText === 'string' ? String( settings.ignoreSearchCase @@ -2536,10 +2542,10 @@ let hasInput = $input.length > 0; let currentValue = module.get.values(); let stringValue = value !== undefined - ? String(value) + ? module.get.stringValue(value) : value; if (hasInput) { - if (!settings.allowReselection && stringValue == currentValue) { + if (!settings.allowReselection && stringValue === module.get.stringValue(currentValue)) { module.verbose('Skipping value update already same value', value, currentValue); if (!module.is.initialLoad()) { return;