-
Notifications
You must be signed in to change notification settings - Fork 436
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
Formsy.Mixin: props name="objectA.keyB" does not produce { ObjectA: {keyB:"value"} } #159
Comments
{ ObjectA{keyB:"value"} }
{ ObjectA{keyB:"value"} }
+1 just ran into this |
Hi, this is fixed in new version #158 |
Thanks @Semigradsky, and to @christianalfoni for a superb library. @adamalbrecht, a short term workaround courtesy of @garbin, detailed at https://github.com/christianalfoni/formsy-react/pull/153/files src/main.js: mapModel: function () {
if (this.props.mapping) {
return this.props.mapping(this.model)
} else {
return Object.keys(this.model).reduce(function (mappedModel, key) {
var keyArray = key.split('.');
var base = mappedModel;
while (keyArray.length) {
var currentKey = keyArray.shift();
base = (base[currentKey] = keyArray.length ? base[currentKey] || {} : this.model[key]);
}
return mappedModel;
}.bind(this), {});
}
}, |
Will close this as it is fixed in new version coming soon, thanks for the feedback @ajaykurien :-) |
@christianalfoni Any idea when the next version containing this fix will be released? |
Release Candidate out now on React, right around the corner :-) Took a bit longer than I thought, but now it is really close! |
The documentation at https://github.com/christianalfoni/formsy-react/blob/master/API.md#name suggests that
should generate a "form model" with a nested object.
{email: 'value', address: {street: 'value'}}
.But when using formsy-react 0.14.1 and react 0.13.3:
produces the following in the console:
i.e. values for individual
A
andB
(zero-length string in this example) but nottextA.A
orTextB.B
.I'd appreciate some guidance. A workaround seems to be to use mapping, but that will get unwieldy quickly.
Thanks!
The text was updated successfully, but these errors were encountered: