Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#45790 closed defect (bug) (worksforme)

Hit undo duplicates an inline image

Reported by: la-geek's profile La Geek Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0.2
Component: Editor Keywords: has-screenshots
Focuses: Cc:


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 5 years ago.
duplicate content.gif (43.4 KB) - added by afercia 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @swissspidy
5 years ago

  • Component changed from General to Editor

#2 @afercia
5 years 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
5 years 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
5 years ago

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

Seems to b fixed in 5.2

#5 @desrosj
5 years ago

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