How to delete one image
when delete one image,all the images deleteed
Please provide a JSBin / jsfiddle containing a set of reproducible steps.
I confirm this is a significant bug. Will make a JSfiddle shortly.
https://codepen.io/malacalypse/pen/YGPokY
- Add an image.
- Add a second image.
- Click on the first (upper) image, and hit the delete button.
- Both images delete.
Wow this is really really weird 😕
As far as we've been able to tell, it's because clicking the remove button on the image simulates a keydown event, which then removes the sibling as well in accordance with the new logic in https://github.com/orthes/medium-editor-insert-plugin/blob/master/src/js/images.js#L520
Is there any solutions here?? I have same issue. I found that after upload images, text some word after images (even could be space), then images can be deleted correct. Weird.
My experience is as follows. 3 pictures added (1, 2, 3). All deletes done using X button. Delete 1: 1 and 3 are removed with 2 remaining. Delete 2: 2 and 3 deleted. Delete 3: 3 deleted twice (command sent to server twice). As bsdo64 said, new text prevents this behavior.
When not using the buttons: Backspacing removes each of the three individually. Clicking on the image and hitting delete on the keyboard works correctly. Setting the caret at the top before all the images and using the delete key removes all the images at once BUT does not send the delete command to the server.