Yuvaleros / material-ui-dropzone

A Material-UI file upload dropzone
MIT License
484 stars 247 forks source link

How to centralize the remove button #242

Open zys opened 4 years ago

zys commented 4 years ago

Is there a way to centralize the remove button in the file preview?

todd-elvers commented 4 years ago

Here's a trimmed down version of what I did:

const styles = useStyles();

...

return (
  <div className={styles.fileDropzone}>
    <DropzoneArea onChange={onChange} />
  </div>
)

The useStyles hook:

const useStyles = makeStyles(() =>
  createStyles({
    fileDropzone: {
      "& .MuiDropzonePreviewList-removeButton": {
        top: "35%",
        left: "40%",
      },
    },
  })
);

The result: Screen Shot 2020-09-28 at 2 48 58 PM