Path in conditional handled different on server/client
Describe the bug When i have the following form definition:
{
"display": "form",
"settings": {
"pdf": {
"id": "1ec0f8ee-6685-5d98-a847-26f67b67d6f0",
"src": "https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0"
}
},
"components": [
{
"label": "first",
"tableView": false,
"validateWhenHidden": false,
"key": "first",
"type": "container",
"input": true,
"components": [
{
"label": "nested",
"tableView": false,
"validateWhenHidden": false,
"key": "nested",
"type": "container",
"input": true,
"components": [
{
"label": "Checkbox",
"tableView": false,
"validateWhenHidden": false,
"key": "checkbox",
"type": "checkbox",
"input": true
},
{
"label": "Text Field",
"applyMaskOn": "change",
"tableView": true,
"validateWhenHidden": false,
"key": "textField",
"conditional": {
"show": true,
"when": "nested.checkbox",
"eq": "true"
},
"type": "textfield",
"input": true
}
]
}
]
},
{
"type": "button",
"label": "Submit",
"key": "submit",
"disableOnInvalid": true,
"input": true,
"tableView": false
}
]
}
The form renderer toggles the visibility of the textfield. When i submit this form, the value of the textbox is lost, because on the server the visibility is determined as not visible and the value is cleared. So either the conditional calculation on the client is broken, and allows subpaths, or the calculation on the server side can't handle subpaths for visibility calculation.
Version/Branch
5.0.0-rc.91 at least also experienced in 4.0.2
To Reproduce
Create a Form with the given definition and submit it. The value for first.nested.textfield is lost
Expected behavior A clear and concise description of what you expected to happen. Either the toggling on client side should not work, or the server should not discard the value.
@tkalmar The value of the textField is lost because the conditionals should be like
"conditional": {
"show": true,
"when": "first.nested.checkbox",
"eq": "true"
}
Let us know if you still have questions.
@VikkiAlenn Yeah, that im aware of. The question is why is this "working" in the gui? Shouldn't the toggle in the guy also not work? The path behaves different in the gui ...
@tkalmar Thank you for your contribution! We created a ticket for our dev team. For the reference: FIO-9380.