diff --git a/README.md b/README.md index 163d24c..0d66d2d 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ See [issues](https://github.com/mbrookes/formsy-material-ui/issues). * 0.2.2 Add prepublish script and associated dev dependency to package.json. * 0.2.3 Fix textfield initialization through this.refs.form.reset(model) (@vijayrawatsan). * 0.2.4 Updated textfield handling (@vijayrawatsan), selectfield fix (@dmlinn). -* 0.2.5 (Unpublished). Fix issue #21 defaults? +* 0.2.5 Fix issue #21 Textfield defaultValue handling. ## Acknowledgements diff --git a/index.js b/index.js index 46ca7e1..a9ba482 100644 --- a/index.js +++ b/index.js @@ -108,6 +108,7 @@ var FormsySelect = React.createClass({ render: function render() { return React.createElement(SelectField, _extends({}, this.props, { onChange: this.handleChange, + errorText: this.getErrorMessage(), value: this.getValue() })); } }); diff --git a/test/TextfieldTests.jsx b/test/TextfieldTests.jsx deleted file mode 100644 index 051b709..0000000 --- a/test/TextfieldTests.jsx +++ /dev/null @@ -1,163 +0,0 @@ -injectTapEventPlugin(); - -let { FormsyText } = FMUI; - -TestForm = React.createClass({ - - childContextTypes: { - muiTheme: React.PropTypes.object - }, - - getChildContext(){ - return { - muiTheme: Styles.ThemeManager.getMuiTheme(Styles.LightRawTheme) - } - }, - - getInitialState: function () { - return { - canSumbit: false - }; - }, - - styles: { - paperStyle: { - width: 300, - margin: 20, - padding: 20 - }, - submitStyle: { - marginTop: 32 - }, - spanStyle: { - marginTop: 32, - fontSize: 10, - fontColor: "grey" - } - }, - - enableButton: function () { - this.setState({ - canSubmit: true - }); - }, - - disableButton: function () { - this.setState({ - canSubmit: false - }); - }, - - submitForm: function (data) { - alert(JSON.stringify(data, null, 4)); - }, - - notifyFormError: function (data) { - console.error('Form error:', data); - }, - - render: function () { - const {paperStyle, submitStyle, spanStyle } = this.styles; - const wordsError = "Please only use letters"; - - return ( - - - - - Name only - all following have a name and some other combination of options. - - - floatingLabelText - - - hintText - - - floatingLabelText, hintText - - - floatingLabelText, defaultValue - - - hintText, defaultValue - - - floatingLabelText, hintText, defaultValue - - - required - - - validation - - - validation, validationError - - - validation, required - - - validation, validationError, required - - - validation, validationError, required, hintText, label - - - - - - ); - } -});