-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Input of type file ignores the accept prop #12369
Comments
@sfratini Sweet. I have never thought of using the Input component for uploading a file. If you have a look at the API, you will find the <Input type="file" inputProps={{ accept: 'audio/mpeg, audio/mp3' }} /> Do you want to add this example to the text field documentation? I think that it's a great demo :). |
@oliviertassinari This is labelled with "good first issue", what needs to be solved? Adding to documentation or passing the |
@arthurtyukayev Thanks for the interest. I was thinking of adding an example in the documentation. How does it sound? |
It is weird because I think I tried that and it didn´t work. I will test this code tomorrow and report my findings. |
Nevermind, it is working. It was a silly mistake on my part. I am using a theme on top of material-ui and it turns out that there is a custom input that uses the same prop name for the inputProps so I just had to repeat it. Here is what I mean:
It is working normally now. Thanks! |
If no one is working on this can I? |
That would be nice. I have never contributed to a public repo so I wouldn´t know where to start |
@sfratini We have a very easy guide which you can follow. Check our Contributing To Material UI Guide You can give it a try, this can be an excellent opportunity to work on one of the most exciting projects in React. If you want to give it a shot let me know. That way I won't work on this one, and you can. If not then let me know that as well 😄 |
|
When using the Input class, if I want to enable just some mime types for upload, the property gets ignored and you can select any file.
Expected Behavior
I would like the file upload selector to only allow certain file types. In my case, MP3 files only.
Current Behavior
Any file (.) is free to be selected.
Steps to Reproduce
First one works, second one does not.
Context
Your Environment
The text was updated successfully, but these errors were encountered: