Fix multi option select handling of default value being hardcoded to a string
This commit is contained in:
parent
4f2079509c
commit
bcc86af4b4
|
@ -11,6 +11,10 @@
|
||||||
$: sanitiseOptions(options)
|
$: sanitiseOptions(options)
|
||||||
|
|
||||||
function getValidOptions(selectedOptions, allOptions) {
|
function getValidOptions(selectedOptions, allOptions) {
|
||||||
|
// Fix the hardcoded default string value
|
||||||
|
if (!Array.isArray(selectedOptions)) {
|
||||||
|
selectedOptions = []
|
||||||
|
}
|
||||||
return selectedOptions.filter(val => allOptions.indexOf(val) !== -1)
|
return selectedOptions.filter(val => allOptions.indexOf(val) !== -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue