Skip to content

Model does not match condition #425

Closed
@ymarcon

Description

@ymarcon

When a condition is set on a field, there can be situations where the model has a value for this field but the condition is not valid.

To reproduce, this is the schema:

{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "title": "Name"
        },
        "eligible": {
            "type": "boolean",
            "title": "Eligible for awesome things"
        },
        "code": {
            "type":"string",
            "title": "The Code"
        }
    }
}

and this is the form:

[
    "name",
    "eligible",
    {
        "key": "code",
        "condition": "model.eligible"
    }
]

The steps are:

  • check "eligible": the field "code" becomes visible
  • enter a value for "code"
  • uncheck "eligible": the field "code" is hidden but the model still contains the value

The resulting model is:

{
  "eligible": false,
  "code": "a code value"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions