Skip to content
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

Dependencies with false values not fullfilled #1559

Open
blauwaldt-it opened this issue May 3, 2024 · 1 comment
Open

Dependencies with false values not fullfilled #1559

blauwaldt-it opened this issue May 3, 2024 · 1 comment
Assignees

Comments

@blauwaldt-it
Copy link

General information

  • json-editor version: 2.15.0

Expected behavior

Depending on aa, bb should be set or not

Actual behavior

bb is never set

Steps to reproduce the behavior

https://json-editor.github.io/json-editor/?data=N4Ig9gDgLglmB2BnEAuUBXRBTA+vAhgLa75RQBOMARulFsihelgDQgTliHQ5VYBmYcrgAmWADZY6qJqxCZRA/OnFQcAN3zjmDWW0L4AHjjHQAFqgAMbGmQQ5EUUrkJgxqAIxsAxvmwOsJBhYdVwOSCxyKABPAPxybwtGcmY2RDMwAHccSM5yBhAYeDpyfG9YBBA2cO41CD86HANjSXgAcygzHGEysywRVH4tbDZhV1CcIfF/cIhI2HpB4blAwQTcbwRHJem5GE34cWpUEEFi/Ez6LiwAVirwKgArLHKccXxosFoT+CEDcXuiESWAMqFAMTmJzATxeUHus3mMEWaBA+HwYJAsCgkhOwO8AGtIvcIVgTlQwGBJPh4Pc1gY4SgQHj8eTDCAAL42KgYkknIp0NpEthiIYqBnWcDQOBIDFmGAiMQ05KpECmQKK7xIhigNE7bDsg0GtidEGkxnksBQRylCAAFg57KAA===

check / unchek "aa", "bb" is never set

now change the dependency "aa": false to "aa": true

https://json-editor.github.io/json-editor/?data=N4Ig9gDgLglmB2BnEAuUBXRBTA+vAhgLa75RQBOMARulFsihelgDQgTliHQ5VYBmYcrgAmWADZY6qJqxCZRA/OnFQcAN3zjmDWW0L4AHjjHQAFqgAMbGmQQ5EUUrkJgxqAIxsAxvmwOsJBhYdVwOSCxyKABPAPxybwtGcmY2RDMwAHccSM5yBhAYeDpyfG9YBBA2cO41CD86HANjSXgAcygzHGEysywRVH4tbDZhV1CcIfF/cIhI2HpB4blAwQTcbwRHJem5GE34cWpUEEFi/Ez6LiwAVirwKgArLHKccXxosFoT+CEDcXuiESWAMqFAMTmJzATxeUHus3mMEWaBA+HwYJAsCgkhOwO8AGtIvcIVgTlQwGBJPh4Pc1gY4SgQHj8eTDCAAL42KgYkknIp0NpEthiIYqBnWcDQOBIDFmGAiMQ05KpECmQKK7xIhigNEyFJYdmGw1sTog0mM8lgKCOUoQAAsHPZQA==

check / uncheck "aa", "bb" is set the right way!

It works up to commit 33b8a1b (4/16/2024, 6:28:58 AM)

Maybe it should be

if (!editor || !editor.dependenciesFulfilled || value === undefined) {

Example schema:

{
    "type": "object",
    "properties": {
        "aa": {
            "title": "checker",
            "type": "boolean",
            "format": "checkbox"
        },
        "bb": {
            "type": "integer",
            "default": 0,
            "options": {
                "hidden": true,
                "dependencies": {
                    "aa": false
                }
            }
        }
    }
}
@zabawiking
Copy link

image
this flag causes issue

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

4 participants