Single image option not working
singleImage prop is still not working correctly when you set it to true, it still lets upload multiple images.
any update on this one
This Issue is very closely related to Issue #59 , I left a comment there.
So far my best quick fix is to add display: 'none' to the buttonStyles prop if there are 1 or more images. This way the button does not appear.
Hi! i've been facing the same problem right now and i've found a better/complementary trick...
if you use this css :
.uploadPictureContainer:not(:last-of-type) {
display: none;
}
only the last selected image will show in the preview, allowing the user to change he's mind and choose an other image whitch visualy will replace previous one. you just need to fix your internal code to only use the last file from the pictures array.
Hope it helps :]
Only issue with using display: none is that if a user deletes the last addition, the old one re-appears. The one that worked best for me was to disable the button when the first image is added:
document.getElementsByClassName("chooseFileButton")[0].disabled = true;
And to make sure your users know that only 1 file is permitted, you can mention that in the label of the ImageUploader component.
Actual