material-ui-dropzone icon indicating copy to clipboard operation
material-ui-dropzone copied to clipboard

Initial files is doubling previews in DropzoneDialog

Open AHD-02 opened this issue 2 years ago • 5 comments

Bug Report

Describe the bug

when passing an array of string length = 1 to initialFiles in the dialog the preview is showing it 2 times

Steps to reproduce

Expected behavior

it should only display it one time

Versions

  • OS: [e.g. iOS]
  • Browser: [e.g. chrome, safari]
  • @mui/material version: [e.g. 5.0.2]
  • material-ui-dropzone version: [e.g. 3.0.1]

Additional context

AHD-02 avatar Feb 13 '23 10:02 AHD-02

Is this issue still open? I would like to work on it. Thanks!

ahmadniaz avatar May 15 '23 11:05 ahmadniaz

@ahmadniaz Still happening to me, it seems the file passed from the initialFiles (even if it's a single file) is being duplicated for some reason, maybe because it's triggering twice in react strict mode. Here you can see the onChange handle triggering twice, the second one with 2 uploaded files even if I only passed a single file to initialFiles:

image

xantorres avatar Nov 29 '23 22:11 xantorres

+1

stayhungry07212 avatar Apr 05 '24 09:04 stayhungry07212

Any update for this issue?

stayhungry07212 avatar Apr 15 '24 10:04 stayhungry07212

@ahmadniaz

stayhungry07212 avatar Apr 15 '24 10:04 stayhungry07212