Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textfield InputProps #15070

Closed
ousmaneMetso opened this issue Mar 27, 2019 · 2 comments
Closed

Textfield InputProps #15070

ousmaneMetso opened this issue Mar 27, 2019 · 2 comments
Labels
support: Stack Overflow Please ask the community on Stack Overflow

Comments

@ousmaneMetso
Copy link

ousmaneMetso commented Mar 27, 2019

Hi,
I have a textfield defined as follow.

<TextField
                className={classes.textField}
                placeholder="Type the number of worker"
                id="standard-worker"
                label="worker"
                onChange={changeHandler('worker')}
                value={value.worker}
                margin="normal"
                variant="outlined" 
                InputProps={{
                  min: "0", 
                  max: "10", 
                  maxLength: "10",
                  guide: false,
                }}
                type= "Number"
              />

I want to not let the user to be able to type in a value that is greater 10 or less than zero by setting the min and max in InputProps. But its not working and I don't quite understand why.
Is there anything im doing wrong?
Thank you

@joshwooding joshwooding added the support: Stack Overflow Please ask the community on Stack Overflow label Mar 27, 2019
@support
Copy link

support bot commented Mar 27, 2019

👋 Thanks for using Material-UI!

We use the issue tracker exclusively for bug reports and feature requests, however,
this issue appears to be a support request or question. Please ask on StackOverflow where the
community will do their best to help. There is a "material-ui" tag that you can use to tag your
question.

If you would like to link from here to your question on SO, it will help others find it.
If your issues is confirmed as a bug, you are welcome to reopen the issue using the issue template.

@racheelllee
Copy link

Apparently type='number' and inputProps={{ maxLength: 3}} is not compatible in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: Stack Overflow Please ask the community on Stack Overflow
Projects
None yet
Development

No branches or pull requests

3 participants