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

App settings: default values for conditionally dependent elements doesn't work #256

Open
kvolden opened this issue Dec 22, 2017 · 0 comments

Comments

@kvolden
Copy link

kvolden commented Dec 22, 2017

If, in your module.json, you make a field conditionally dependent and give it a default value, the default value is ignored. This works fine with Alpaca (1.5.17) alone, so this appears to be Z-Way specific.

The attached JSFiddle shows it working with Alpaca, but if you use the same structure in a module, the default value is ignored. The element does not fill with its default value when rendered, and the element is not passed to the module on form submission if left empty.

https://jsfiddle.net/kvolden/f12qmjwh/

The relevant part of module.json:

    "options": {
        "fields": {
            "a_checkbox": {
                "rightLabel": "Check this for another element"
            },
            "another_element": {
                "label": "Another element with default value",
                "dependencies": {
                    "a_checkbox": true
                }
            }
        }
    },
    "schema": {
        "type": "object",
        "properties": {
            "a_checkbox": {
                "type": "boolean"
            },
            "another_element": {
                "default": 3
            }
        },
        "dependencies": {
            "another_element": "a_checkbox"
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant