gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Undo removes pre-existing, already saved content

Open afercia opened this issue 9 years ago • 6 comments

Currently on master, to reproduce:. edit a post that already has some pre-existing content, for example a simple title and text:

screen shot 2017-06-23 at 19 11 25

Add something to the title, and add something to the text:

screen shot 2017-06-23 at 19 11 52

Press the "Undo" button: all the paragraph text gets removed:

screen shot 2017-06-23 at 19 11 56

In this example. it should remove just Hello.

afercia avatar Jun 23 '17 17:06 afercia

@afercia I can no longer replicate this on master, currently works as you expect

tg-ephox avatar Aug 03 '17 05:08 tg-ephox

@tg-ephox true, can't reproduce any longer. However, there's something that doesn't look right to me. In the same, simple, example above:

  • I add the word "more" to the title
  • I add the word "more" to the text block
  • clicking undo:
    • with just one click, the "more" in the text gets deleted all together
    • at the second Undo click, the "e" in the title "more" gets deleted, and at the following clicks same: one letter at a time

afercia avatar Aug 03 '17 07:08 afercia

@afercia that's because currently the text block is wrapping TinyMCE and the block only gets the new content once TinyMCE loses focus . So all changes made within TinyMCE will be captured as a single change in regard to redo/undo.

tg-ephox avatar Aug 03 '17 07:08 tg-ephox

@tg-ephox thanks, now I understand the technical reason behind this.

However, the more I test undo / redo, the more I'm worried about potential content loss and any sort of breakage in the users editing flow.

I think the current behavior is confusing and it's also very different from the behavior in the classic editor. Probably a bit overlooked so far, but I feel this is one of the features that should be definitely improved.

afercia avatar Aug 04 '17 13:08 afercia

Should this get closed by #4956

youknowriad avatar Feb 15 '18 13:02 youknowriad

Undo has undergone significant changes lately. Specific issues should be addressed individually.

For the title "one character at a time", this is tracked at #4057

aduth avatar Mar 06 '18 14:03 aduth