-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
List block: Undo/redo history breaks when undoing list block creation #44196
Comments
I tried to debug the issue and found out that it might be caused by how the inner blocks are updated via the NOTE 1: I debugged this issue using the native version, but as mentioned in this comment, this issue is common on both platforms so we should expect the same results in the web version. NOTE 2: I tested the undo/redo behavior on other blocks that use inner blocks (e.g. Group block) and I encountered similar issues. In order to provide a better context, let me share some results about the debugging session I did: Steps done before debugging:
After these steps, the state of the At this point, clicking on the "Redo" button leads to the problem described in the issue's description. Doing this produces the execution of two The first one that restores the List block:
However, this action is detected as a change by the
Potential solutionNot sure if it's possible, but we should detect somehow when updating the inner block's content if the change was generated by the user or a redo action. If the latter, the |
Hey, I'm gonna work on this :) |
I've just checked this on the latest Gutenberg version and it is working as expected, I'm guessing some of the improvements added to the block fixed the problem. What do you think if we close this ticket @fluiddot ? |
Sure, I've just tested the app (version |
Description
After inserting a List block and adding list items, undoing all actions until the List block is removed breaks the undo/redo history.
Step-by-step reproduction instructions
Expected: The "Redo" button should restore all the content that has been undone.
Screenshots, screen recording, code snippet
list-block-undo-redo-history.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: