Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0b07b8f

Browse files
author
jonatansalas
committed
#35 #43 #51 Fixed Number component not setting max and min
1 parent 51a9f36 commit 0b07b8f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

‎src/components/common/FormControl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class FormControl extends Component {
2424
};
2525

2626
getInput = () => {
27-
let { value, placeholder, componentClass, children, rows, inputType } = this.props;
28-
let formControlProps = { value, placeholder, componentClass, rows };
27+
let { value, placeholder, componentClass, children, rows, inputType, min, max } = this.props;
28+
let formControlProps = { value, placeholder, componentClass, rows, min, max };
2929

3030
return (
3131
<BootstrapFormControl type={inputType} ref="input" onChange={this.handleChange} onBlur={this.handleBlur} {...formControlProps}>

‎src/components/common/Input.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ class Input extends Component {
2828
min, max
2929
} = this.props;
3030

31-
console.info("This is the min -> " + min);
32-
console.info("This is the max -> " + max);
33-
3431
let formGroupProps = {
3532
error,
3633
touched,
@@ -54,11 +51,13 @@ class Input extends Component {
5451
onBlur,
5552
componentClass,
5653
rows,
54+
min,
55+
max
5756
};
5857

5958
return (
6059
<FormGroup {...formGroupProps}>
61-
<FormControl {...formControlProps}min={min}max={max}>
60+
<FormControl {...formControlProps}>
6261
{ children }
6362
</FormControl>
6463
</FormGroup>

‎src/components/field/Number.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class Number extends Component {
1111
error: PropTypes.string,
1212
addonBefore: PropTypes.string,
1313
addonAfter: PropTypes.string,
14-
fieldLayout: PropTypes.string
14+
fieldLayout: PropTypes.string,
15+
min: PropTypes.number,
16+
max: PropTypes.number
1517
};
1618

1719
render() {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /