diff --git a/core/misc/states.js b/core/misc/states.js index 89b9ec9..88adc0c 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -108,6 +108,9 @@ if (!Array.isArray(value)) { return false; } + // Convert all comparisons to strings for indexOf to work with integers comparing to strings + reference = reference.map(String); + value = value.map(String); // We iterate through each value provided in the reference. If all of them // exist in value array, we return true. Otherwise return false. for (var key in reference) { @@ -215,7 +218,7 @@ */ update: function (selector, state, value) { // Only act when the 'new' value is actually new. - if (value !== this.values[selector][state.name]) { + if (value !== this.values[selector][state.name] || $(selector).prop('multiple')) { this.values[selector][state.name] = value; this.reevaluate(); }