Skip to content
Snippets Groups Projects

Issue #1149078: States API doesn't work with multiple select fields

Open Issue #1149078: States API doesn't work with multiple select fields
2 unresolved threads
2 unresolved threads
Files
3
+ 10
0
@@ -149,6 +149,7 @@
*
* @prop {function} RegExp
* @prop {function} Function
* @prop {function} Array
* @prop {function} Number
Please register or sign in to reply
*/
states.Dependent.comparisons = {
@@ -159,6 +160,15 @@
// The "reference" variable is a comparison function.
return reference(value);
},
Array(reference, value) {
// Make sure value is an array.
if (!Array.isArray(value)) {
return false;
}
// The arrays values should match.
return JSON.stringify(reference.sort()) === JSON.stringify(value.sort());
},
Number(reference, value) {
// If "reference" is a number and "value" is a string, then cast
// reference as a string before applying the strict comparison in
Loading