Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
formBuilder.setData() doesn't work for custom numeric attributes #945
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:
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:
Custom numeric attributes are re-loaded by formBuilder.setData()
Steps to Reproduce