Skip to content

Commit 5f40dd1

Browse files
committed
feature: add support for maxLength, minLength and step
1 parent 9d9f73e commit 5f40dd1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/CustomInput/CustomInput.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ export default function CustomInput(props) {
4040
const marginTop = classNames({
4141
[classes.marginTop]: labelText === undefined,
4242
});
43+
let newInputProps = {
44+
maxLength:
45+
inputProps && inputProps.maxLength ? inputProps.maxLength : undefined,
46+
minLength:
47+
inputProps && inputProps.minLength ? inputProps.minLength : undefined,
48+
step: inputProps && inputProps.step ? inputProps.step : undefined,
49+
};
4350
return (
4451
<FormControl
4552
{...formControlProps}
@@ -62,6 +69,7 @@ export default function CustomInput(props) {
6269
}}
6370
id={id}
6471
{...inputProps}
72+
inputProps={newInputProps}
6573
/>
6674
{error ? (
6775
<Clear className={classes.feedback + " " + classes.labelRootError} />

0 commit comments

Comments
 (0)