viclafouch / mui-file-input

A file input designed for the React library MUI
https://viclafouch.github.io/mui-file-input/
MIT License
77 stars 17 forks source link

Icons are not displayed #50

Closed DaliborHomola closed 3 months ago

DaliborHomola commented 3 months ago

Describe the bug Input doesn't show any icons. When I upload a file, it is hard to clear the input because the delete icon is missing.

To Reproduce Steps to reproduce the behavior:

  1. Go to codesandbox
  2. See missing icons before / after upload file.
viclafouch commented 3 months ago

Yes, that's normal. You have to show it by yourself using InputProps.

<MuiFileInput
          sx={{ width: 300 }}
          placeholder="Choisir un fichier"
          clearIconButtonProps={{
            children: <CloseIcon fontSize="small" />
          }}
          InputProps={{
            startAdornment: <AttachFileIcon />
          }}
          required
          multiple
          value={value}
          onChange={handleChange}
          label="Your photo"
        />