From 80617286befb31fa7d7596d7f27961abc6b6cff3 Mon Sep 17 00:00:00 2001 From: sumitdaga Date: Thu, 8 Mar 2018 17:41:34 +0530 Subject: [PATCH] enhanced text input with min and max if type is number --- components/Formsy/TextInput.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/Formsy/TextInput.jsx b/components/Formsy/TextInput.jsx index 0bdf99357..64ed864a5 100644 --- a/components/Formsy/TextInput.jsx +++ b/components/Formsy/TextInput.jsx @@ -16,7 +16,7 @@ class TextInput extends Component { } render() { - const { label, name, type, placeholder, wrapperClass, maxLength, theme } = this.props + const { label, name, type, minValue, maxValue, placeholder, wrapperClass, maxLength, theme } = this.props const hasError = !this.props.isPristine() && !this.props.isValid() const wrapperClasses = classNames(wrapperClass, theme) const classes = classNames('tc-file-field__inputs', {error: hasError}, {empty: this.props.getValue() === ''}) @@ -35,6 +35,8 @@ class TextInput extends Component { disabled={disabled} onChange={this.changeValue} maxLength={maxLength} + min={minValue} + max={maxValue} /> { hasError ? (

{errorMessage}

) : null}