WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 weeks ago

Last modified 5 weeks 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:

Description

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

Download all attachments as: .zip

Change History (7)

#1 @swissspidy
5 months ago

  • Component changed from General to Editor

#2 @afercia
5 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
5 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!):
https://drive.google.com/file/d/1NQbCtgU7urnTqWgAjWqvY1Is-tHx9-gY/view

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 weeks ago

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

Seems to b fixed in 5.2

#5 @desrosj
5 weeks ago

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