Skip to content

Model does not match condition #425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ymarcon opened this issue Jun 9, 2015 · 5 comments
Closed

Model does not match condition #425

ymarcon opened this issue Jun 9, 2015 · 5 comments
Milestone

Comments

@ymarcon
Copy link

ymarcon commented Jun 9, 2015

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"
}
@ymarcon
Copy link
Author

ymarcon commented Jun 9, 2015

I see in #371 that it will be fixed in the next release, thanks!

@ymarcon ymarcon closed this as completed Jun 9, 2015
@ymarcon
Copy link
Author

ymarcon commented Jun 18, 2015

I just tested with the latest commit and the example provided still does not work. It works with arrays but not with that simple example.

@ymarcon ymarcon reopened this Jun 18, 2015
@xArthasx
Copy link

xArthasx commented Jul 9, 2015

I have the same issue.

@ryantehbaker
Copy link

ryantehbaker commented May 9, 2017

I am also experiencing this issue

@Anthropic Anthropic modified the milestones: 1.0.0, Backlog May 10, 2017
@Anthropic
Copy link
Member

@ryantehbaker I tried @ymarcon's example on the example plunker and it worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants