Initialize an Image Input with the initial image as the above demo.
- Step 1: Upload a new image => Cancel button appears
- Step 2: Click on Cancel button to remove the new uploaded image => Initial image & Remove button appear => Reasonable
- Step 3: Click on Remove button to delete the existing image.
- Step 4: Upload a new image AGAIN => Cancel button appears
- Step 5: Click on Cancel button to remove the new uploaded image
=> The initial image & Remove button appear again which had been deleted from the Step 3
I know you have reason to bring back the initial image after cancelling the new uploaded image. However, this loop should be stopped after the Remove button is clicked.
Well, I think we should supply a method to set up/remove the initial image. In fact, we can save & remove images many times.
- Remove: we should clear the initial image in the component to prevent the above loop.
- Save: we should set up the NEW initial image. From this point, this image becomes the initial image which will be brought back if I upload another image then cancel it.
This is just my suggestion in hope that you can consider all cases any.
Thank you for your feedback. Good points.
We will check this further and consider those improvements.