Make WordPress Core

Opened 13 months ago

Closed 9 months ago

Last modified 9 months ago

#45790 closed defect (bug) (worksforme)

Hit undo duplicates an inline image

Reported by: La Geek Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0.2
Component: Editor Keywords: has-screenshots
Focuses: Cc:
PR Number:


Insert an inline image, set the cursor before the image hit return, click undo, the image is duplicated

Attachments (2)

duplicated_bug.gif (860.6 KB) - added by La Geek 13 months ago.
duplicate content.gif (43.4 KB) - added by afercia 13 months ago.

Download all attachments as: .zip

Change History (7)

#1 @swissspidy
13 months ago

  • Component changed from General to Editor

#2 @afercia
13 months ago

  • Keywords has-screenshots added

Nice catch :)

Seems to me this happens with any content, also with plain text, and it's probably a bug in the Undo component (see attached GIF below).

Pressing Enter at the beginning of a paragraph creates a new paragraph above the previous one. In a sense, the previous paragraph has been "emptied".

I'd then expect Undo to remove the newly added paragraph, instead it first populates the previous paragraph with the content it thinks has been "removed".

#3 @subrataemfluence
13 months ago

what I have found is when I hit an Enter before the first character of a paragraph block, the content becomes empty although the focus still stays inside that block.

Please see this screencast (Sorry for the poor quality!):

Not sure if this helps but looks like the Enter key is removing current value (He) from content node of the object and making it empty. It should instead update the value of it with \nHe. Probably because it is making it empty, an additional "empty" block is being created?

#4 @La Geek
9 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

Seems to b fixed in 5.2

#5 @desrosj
9 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.