-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Values on array-values broken?! #19
Comments
@stretau did you find a workaround for this? Facing the same issue |
Stale issue |
I am facing same issue. Please let me know if there is any workaround. |
Possible solution: updateValue(event) {
const lValues = event.value.map(item => {
return `${item}`;
}).join(',');
this.jsf.updateValue(this, `[${lValues}]`);
} This method saves an array in jsf.data |
Ended up doing below. updateValue(event) { |
Describe the bug
which template:
A clear and concise description of what the bug is.
To Reproduce
It seems there is something broken with Updating the form value correctly when using array-types. But maybe I do sth. wrong
Eventually consider this PR in angular2-json-schema-form:
https://github.com/dschnelldavis/angular2-json-schema-form/pull/304
I have written my own widget which use ng-select https://github.com/ng-select/ng-select:
This Component I successfully register as new Widget for angular6-json-schema-form. My ng-select component is rendered successfully. But if I activate the "multiple"-Option, the value in "updateValue" is an array. Because of this my Schema is like this:
If I add one value from ng-select. Everything is fine. The form value for inv_reason is an array which contains the first selected option. But if I add one more item, then console.log error occured with the following:
Expected behavior
The array-value should be correct updated in the form.
I'm using Angular 6 and the latest version of this package here.
Thx in advance, Best Regards
The text was updated successfully, but these errors were encountered: