Prevent boolean as string when switching filter (#12597)

This commit is contained in:
Azri Kahar
2022-04-06 21:25:00 +08:00
committed by GitHub
parent b4538ca7a3
commit 17edc01f6f

View File

@@ -273,7 +273,12 @@ function updateComparator(index: number, operator: keyof FieldFilterOperator) {
}
break;
default:
update(Array.isArray(value) ? value[0] : value);
// avoid setting value as string 'true'/'false' when switching from null/empty operators
if (['_null', '_nnull', '_empty', '_nempty'].includes(nodeInfo.comparator)) {
update(null);
} else {
update(Array.isArray(value) ? value[0] : value);
}
break;
}