Fix logic for multi select (#6)

* Fix logic for multi select

* test case for multi select logic
This commit is contained in:
Chirag
2022-10-03 00:10:10 +05:30
committed by GitHub
parent ef70be9d14
commit 610c71cb69
6 changed files with 124 additions and 28 deletions

View File

@@ -64,7 +64,13 @@ function checkContains (condition, fieldValue) {
}
function checkListContains (condition, fieldValue) {
return (fieldValue && fieldValue.length > 0) ? condition.value.every(r => fieldValue.includes(r)) : false
if (!fieldValue) return false
if (Array.isArray(condition.value)) {
return condition.value.every(r => fieldValue.includes(r))
} else {
return fieldValue.includes(condition.value)
}
}
function checkStartsWith (condition, fieldValue) {