medium-editor-insert-plugin icon indicating copy to clipboard operation
medium-editor-insert-plugin copied to clipboard

How to delete one image

Open entere opened this issue 10 years ago • 7 comments

when delete one image,all the images deleteed

entere avatar Apr 13 '16 10:04 entere

Please provide a JSBin / jsfiddle containing a set of reproducible steps.

j0k3r avatar Apr 13 '16 11:04 j0k3r

I confirm this is a significant bug. Will make a JSfiddle shortly.

malacalypse avatar Sep 06 '16 18:09 malacalypse

https://codepen.io/malacalypse/pen/YGPokY

  1. Add an image.
  2. Add a second image.
  3. Click on the first (upper) image, and hit the delete button.
  4. Both images delete.

malacalypse avatar Sep 06 '16 19:09 malacalypse

Wow this is really really weird 😕

j0k3r avatar Sep 06 '16 19:09 j0k3r

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

lauranjansen avatar Sep 06 '16 20:09 lauranjansen

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.

bsdo64 avatar Sep 28 '16 06:09 bsdo64

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.

Stardog avatar Sep 12 '17 20:09 Stardog