You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Our users have some calculated values in their Text Field component that do not display if a comment is made after the value is calculated.
For example, if a text field has the API property name set to A and a second text field uses a calculated value of value = data.A, the second field mirrors the input from the first. But if a comment is added value = data.A //comment, the text field remains blank.
I understand this is because the entire calculated value is evaluated as a string in the calculateValue property of the form's JSON, and adding a comment at the end does not return any value. Is that correct?
hi, formio is glueing 'return value' to the end of the script, so in your case that would be
//test comment return value
in that scenario return is a part of the comment so will be omitted by the evaluator
would be nice if formio team could fix that by glueing return to the new line, or maybe even by requiring return statement from users (makes sense especially when we're using if statements with early returns)
the fast workaround is just placing comments not on the last line of script
We have created a ticket for this. In the meantime, if you would like to submit a pull request, we would review it.
Ticket for internal tracking: FIO-8803
Describe the bug
Our users have some calculated values in their Text Field component that do not display if a comment is made after the value is calculated.
For example, if a text field has the API property name set to
A
and a second text field uses a calculated value ofvalue = data.A
, the second field mirrors the input from the first. But if a comment is addedvalue = data.A //comment
, the text field remains blank.I understand this is because the entire calculated value is evaluated as a string in the
calculateValue
property of the form's JSON, and adding a comment at the end does not return any value. Is that correct?Is this a bug that can be fixed?
Version/Branch
Sandbox (Default)
To Reproduce
Steps to reproduce the behavior:
66da30361aeaa15811339869
and Load SandboxExpected behavior
The value should be displayed in both text fields.
Screenshots
The text was updated successfully, but these errors were encountered: