-
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
Test new version of Formsy-React with React 0.14 #158
Comments
Hello there, Some good stuff in this release, thanks! I've been having trouble getting the multiple error messages to show (code below). The validations seem to be running correctly, but it seems to only return the generic "fallback" error message. var React = require('react');
var ReactDOM = require('react-dom');
var Formsy = require('formsy-react');
var ValidationTest = React.createClass({
mixins: [Formsy.Mixin],
renderErrors() {
var errorMessages = this.getErrorMessages() || [];
return errorMessages.map((message, key) => {
return (
<p key={key}>Error: {message}</p>
);
});
},
onChange(e) {
this.setValue(e.currentTarget.value);
},
render() {
return (
<div>
{this.isRequired() ? '* ' : ''}
<input
type="text"
value={this.getValue()}
onChange={this.onChange}
required={this.props.required}
/>
{this.renderErrors()}
</div>
);
}
});
var App = React.createClass({
render() {
return (
<Formsy.Form onSubmit={(model) => { console.log(model); }} noValidate>
<ValidationTest
name="nesting[for][the][win]"
validations={{
isEmail: true,
maxLength: 8
}}
validationErrors={{
isEmail: 'Is not an email address.',
maxLength: 'Maximum length is 8.'
}}
validationError="Generic error."
required
/>
<input type="submit" />
</Formsy.Form>
)
}
});
ReactDOM.render(<App/>, document.body); |
@Semigradsky super! Here's an edge case for you! When the component is set as 'required', and the value is empty (i.e The work-around is to check for |
Yeah, I think |
Hi guys! @twisty thanks so much for taking the time to test! @Semigradsky Great work, we are closing in on release :-) NOTE! to get the latest version of master in the TEST-project, run |
@Semigradsky Maybe create a couple of tests for these errors messages, I was not in the mood for it when I implemented... you know how it is ;-) |
Thanks for the great project. Does this version fix the issue presented in #110? |
@richardaday , jup it does :-) |
Hi there! As soon as React 0.14 is released it will be released :-) The code is ready, working with React 0.14 Beta 1 |
Anyway to publish it to npm with a beta version? |
Hi. Thanks for the great work. Really like the flexibility. Any plans to convert to using a decorator (or away from a mixin in some fashion)? I tried using react-mixin-decorator but the issue where dug too deep in to mess with it. |
Decorators will be part of next release :-) |
Hi, Best Regards. |
Hm, I did not quite understand what you mean @eriknyk? |
New version out |
Great! 🍻 |
Any updates here? |
Hello there!
I am working on the new release of Formsy-React, using the BETA version of React 0.14 (https://facebook.github.io/react/blog/2015/07/03/react-v0.14-beta-1.html). React 0.14 brings a long some necessary fixes to make Formsy take its next step.
It would be great if you could help test this new version and add any issues to the comments below. I have set up a small repo to make it as easy as possible for you to test the new functionality.
Get started
npm install
npm start
http://localhost:8080/webpack-dev-server/bundle
It is ready with ES6 syntax and JSX syntax, using Webpack and Babel.
Fixes in new version
required
andvalidations
props can now be changed at runtime and the form will re-validate itselfWarning
event.target.value
is not available, useevent.currentTarget.value
The text was updated successfully, but these errors were encountered: