[Question] Calculate Value not working when Allow Manual Override of Calculated Value is selected.
TusharGoel14 opened this issue · comments
Environment
Please provide the details on the working of the same.
If we add a logic to get value in calculated value and click on Allow Manual Override of Calculated Value then values are not getting set as per the logic.
- Hosting Type : Form.io (https://formio.github.io/formio.js/app/sandbox.html)
- Formio.js Version : Latest 4.x (Default)
- Browser : Chrome
Steps to reproduce
- Create the text field and enable Multiple Values and save.
- Create the Text Area, enable Multiple Values, in Calculate Value add
value = data.textField
, select the Allow Manual Override of Calculated Value and Save - In the Renderer add the values in textField
Expected Behaviour
Values added in textField should be added in textArea along with Manual values we are adding in textArea
Observed Behaviour
Values added in textField are not added in textArea though we can manually add the values
Example
For code or form JSON, please enclose in a code block:
{
"display": "form",
"components": [
{
"label": "textField",
"applyMaskOn": "change",
"tableView": true,
"multiple": true,
"defaultValue": [
""
],
"key": "textField",
"type": "textfield",
"input": true
},
{
"label": "Text Area",
"applyMaskOn": "change",
"autoExpand": false,
"tableView": true,
"multiple": true,
"calculateValue": "value = data.textField",
"allowCalculateOverride": true,
"key": "textArea",
"type": "textarea",
"input": true
},
{
"type": "button",
"label": "Submit",
"key": "submit",
"disableOnInvalid": true,
"input": true,
"tableView": false
}
]
}
Note
This behavior is only observed when Allow Manual Override of Calculated Value is enabled and component have multiple values enabled.
In both the cases Allow Manual Override of Calculated Value is enabled
- Case 1
- textField : Multiple Values not enabled
- textArea : Multiple Values Enabled
- Observation : Value added in text field populated in textArea and we can add values manually also.
- Case 2
- textField : Multiple Values Enabled
- textArea : Multiple Values Enabled
- Observation : Value added in text field not populated in textArea, we can add values manually in textArea