Material-ui: [Input] Add -multiple- parameter to allow multiple file selection

Created on 19 Oct 2018  路  2Comments  路  Source: mui-org/material-ui

Expected Behavior

<Input id="assets" name="assets" type="file" multiple />
Generated html input parameter don't have this multiple parameter, so in Select file dialog only one file can be selected

Current Behavior

Generated HTML:
<input aria-invalid="false" class="MuiInputBase-input-452 MuiInput-input-437 MuiInputBase-inputType-455 MuiInput-inputType-440" id="assets" name="assets" required="" type="file" value="">

There is not multiple attribute so only one file can be selected

TextField question

Most helpful comment

@stolex Following the documentation, there is a property for all the non-frequent attributes.

<Input id="assets" name="assets" type="file" inputProps={{ multiple: true }} />

All 2 comments

@stolex Following the documentation, there is a property for all the non-frequent attributes.

<Input id="assets" name="assets" type="file" inputProps={{ multiple: true }} />

@oliviertassinari Can you please link the documentation you are referring to or some documentation about the specifics of the inputProps?

Or perhaps you may be able to simply help me. I would like to limit the number of files the user can upload to three at a time. Is this possible?

Was this page helpful?
0 / 5 - 0 ratings