-
Notifications
You must be signed in to change notification settings - Fork 170
Closed
Description
Currently when using an $ANY$ expression in a visibleIf statement it does not validate correctly on number fields or anything without a length property such as numbers, booleans etc.
The way it's currently testing for validity of a value with $ANY$ is with this:
| valid = value && value.length > 0; |
I'm proposing we change that to something that can handle all possible values such as:
if(Array.isArray(value)) {
valid = value.length > 0;
} else if(typeof value === "number") {
valid = true;
} else if(typeof value === "boolean") {
valid = true;
} else if(typeof value === "string") {
valid = value !== '';
} else if(typeof value === "object") {
valid = value !== null && value !== {};
}
Pull request with this change to follow. Feel free to share thoughts/improvements on this solution.
Metadata
Metadata
Assignees
Labels
No labels