Skip to content

Commit 3764ab7

Browse files
authored
Merge pull request #285 from sumitdaga/issue-1744-connect-app
enhanced text input with min and max if type is number
2 parents 2850ce1 + 8061728 commit 3764ab7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/Formsy/TextInput.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TextInput extends Component {
1616
}
1717

1818
render() {
19-
const { label, name, type, placeholder, wrapperClass, maxLength, theme } = this.props
19+
const { label, name, type, minValue, maxValue, placeholder, wrapperClass, maxLength, theme } = this.props
2020
const hasError = !this.props.isPristine() && !this.props.isValid()
2121
const wrapperClasses = classNames(wrapperClass, theme)
2222
const classes = classNames('tc-file-field__inputs', {error: hasError}, {empty: this.props.getValue() === ''})
@@ -35,6 +35,8 @@ class TextInput extends Component {
3535
disabled={disabled}
3636
onChange={this.changeValue}
3737
maxLength={maxLength}
38+
min={minValue}
39+
max={maxValue}
3840
/>
3941
{ hasError ? (<p className="error-message">{errorMessage}</p>) : null}
4042
</div>

0 commit comments

Comments
 (0)