react-images-upload icon indicating copy to clipboard operation
react-images-upload copied to clipboard

Fixing index bug when there are DefaultImages

Open glaudsonsilva opened this issue 5 years ago • 3 comments

When the component there is defaultImage it is stored in state.pictures but not in state.files since it has no file. The problem is when I upload a image and before submit it I decide to remove it. The removeImage function get it's index from the state.pictures, which going to be 1, but the file is stored in the position 0 of state.files.

To fix it I created empty objects when there are default images to keep both array with the same size and index consistency. To finish up I built a filter before send the files up to the parent component, since undefined objects are not useful there.

glaudsonsilva avatar Dec 03 '20 18:12 glaudsonsilva

Is this project officially dead or can we get this merged? If dead is there a fork on NPM we can use instead?

jjmerri avatar Mar 20 '21 04:03 jjmerri

How to fix the issue of not previewing the new uploaded image? When uploading i'm still getting the same defaultImage prop

fidaay avatar Mar 24 '21 08:03 fidaay

Is this fixed?i'm also getting previous default image after upload new image

YasiruDev avatar Apr 17 '21 05:04 YasiruDev