Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo: merely putting the caret in a new post creates an undo level #14952

Open
ellatrix opened this issue Apr 12, 2019 · 5 comments
Open

Undo: merely putting the caret in a new post creates an undo level #14952

ellatrix opened this issue Apr 12, 2019 · 5 comments
Labels
[Feature] History History, undo, redo, revisions, autosave. [Type] Bug An existing feature does not function as intended

Comments

@ellatrix
Copy link
Member

Describe the bug

To reproduce

  1. Create a new post.
  2. Place the caret in the empty post.
  3. Notice that an undo level is created (undo button lights up). Also notice that the post cannot be saved, indicating that nothing changed.

Expected behavior

The content should not have changed and there should be no undo levels.

@ellatrix ellatrix added the [Feature] History History, undo, redo, revisions, autosave. label Apr 12, 2019
@aduth
Copy link
Member

aduth commented Apr 12, 2019

I don't know that this is strictly wrong in that the history reflects the creation of a block. The fact that the post can't be saved is more a consequence of the special handling of a post which contains only a single empty default block (#9808).

@ellatrix
Copy link
Member Author

I understand what happens technically behind the scenes, but from a user's perspective, this feels buggy. The user didn't really create any content yet. I don't think any other editor out there would do this.

@aduth
Copy link
Member

aduth commented Apr 17, 2019

The user didn't really create any content yet.

I guess this depends whether the user considers the act of placing the caret as equivalent to adding a new paragraph block (which it is).

In all, I'd probably tend to agree with you that as much as we can consider the simple act of placing a caret as more akin to placing a caret into any other word processor (as a "noop"), the better (including change detection, I think).

@swissspidy
Copy link
Member

Issues like this one, but also #12273, #12272, or for example #12271 show that unnecessary undo levels are created for non-user-driven actions. In all of these scenarios I (as a user) would expect to undo only the actions I took.

So if the history stack looks like this:

  1. User action B
  2. Programmatic action done by the editor C
  3. Programmatic action done by the editor B
  4. Programmatic action done by the editor A
  5. User action A

And if I click undo, I would expect my user action B to be undone. But the editor behind the scenes would undo all the programmatic actions as well. So behind the scenes the stack would look like this in the end:

  1. User action A

@swissspidy swissspidy added the [Type] Bug An existing feature does not function as intended label May 17, 2019
@aduth
Copy link
Member

aduth commented May 20, 2019

Related (some redundancy): #8119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] History History, undo, redo, revisions, autosave. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants