RXNT / react-jsonschema-form-conditionals

react-jsonschema-form-conditionals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support boolean logic for multiple fields

mavarazy opened this issue · comments

#4 is enough for simple cases of comparison related for a single field, but in case we need to interact with multiple fields, it's not enough.

For example, we want to hide password field, when firstName is missing or nickName is admin.
We can express this like this:

let rules = {
    password: {
        action: "remove",
        when: { "or" : [ { firstName: "empty"} , { nickName: "admin" } ] },
    }
}