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
However, when the formData JSON is saved and re-loaded using formBuilder.setData(), the custom field's value (14, in the example above) is not set for the custom attribute's edit panel field -- the input field is empty.
I've traced this down to a problem in the numberAttribute() function when it is used for custom attributes. The issue is with the following line:
const attrVal = attrs[attribute];
When called from processTypeUserAttrs(), attribute is "audioIndex" and attrs looks like this:
{
label: "Audio index",
value: "14"
}
Since there is no "audioIndex" attribute in attrs, attrVal is undefined and the value is not restored to the input field.
I was able to fix this by changing the above line to the following:
const attrVal = attrs[attribute] || attrs.value;
Environment Details:
formBuilder Version: 3.1.3
Browser: Chrome
OS: Win10
Expected Behavior
Custom numeric attributes are re-loaded by formBuilder.setData()
Actual Behavior
They're not.
Steps to Reproduce
See above.
The text was updated successfully, but these errors were encountered:
Description:
I've defined a custom control attribute as follows:
In the formBuilder edit panel, this renders correctly as an input of type "number" and any value specified is properly set in the control's formData:
However, when the formData JSON is saved and re-loaded using formBuilder.setData(), the custom field's value (14, in the example above) is not set for the custom attribute's edit panel field -- the input field is empty.
I've traced this down to a problem in the numberAttribute() function when it is used for custom attributes. The issue is with the following line:
const attrVal = attrs[attribute];
When called from processTypeUserAttrs(), attribute is "audioIndex" and attrs looks like this:
Since there is no "audioIndex" attribute in attrs, attrVal is undefined and the value is not restored to the input field.
I was able to fix this by changing the above line to the following:
const attrVal = attrs[attribute] || attrs.value;
Environment Details:
Expected Behavior
Custom numeric attributes are re-loaded by formBuilder.setData()
Actual Behavior
They're not.
Steps to Reproduce
See above.
The text was updated successfully, but these errors were encountered: