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/redo: Undoing a "enter for new block" action seems to add several actions to the Undo history #307

Closed
mzorz opened this issue Nov 30, 2018 · 3 comments

Comments

@mzorz
Copy link
Contributor

mzorz commented Nov 30, 2018

Undoing a "enter for new block" action seems to add several actions to the Undo history:

  1. launch the app
  2. tap in the middle of "Wel|come" in the "Welcome to Gutenberg" title
  3. tap enter key
  4. observe a new block is created
    5.a tap undo, observe first tap does nothing
    5.b tap undo again, observe new block is deleted, and "Welcom|" gets formed in the original block
    5.c tap undo again, observe the original block now really gets the original content "Welco|me to Gutenberg", and see the cursor is after the "o" in "Welcome".

Expected behavior:

  • After step 4, tapping undo should bring state to step 1.
@hypest hypest added this to the Alpha milestone Dec 5, 2018
@mzorz mzorz self-assigned this Dec 11, 2018
@mzorz
Copy link
Contributor Author

mzorz commented Dec 12, 2018

This issue is mirrored on GB side in WordPress/gutenberg#8882 and this PR WordPress/gutenberg#11005 addresses it.

Leaving this one open til then.

@mzorz mzorz removed their assignment Dec 12, 2018
@mzorz mzorz modified the milestones: Alpha, Beta Dec 12, 2018
@mchowning
Copy link
Contributor

Just wanted to leave a note that in testing on Android I cannot recreate the issue in the "Welcome to Gutenberg" title, but I can recreate the issue (or rather very similar issues) in other blocks.

Heading

  1. launch app
  2. tap in the middle of "What is Gute|nberg?" heading
  3. tap enter key
  4. observe a new heading block is created, so heading block 1 contains "What is Gute", and heading block 2 contains "nberg?"
  5. tap undo, observe heading block 1 is restored to "What is Gutenberg?", but heading block 2 still contains the cursor and "nberg?"
  6. tap undo a 2nd time, heading block 2 is removed, heading block 1 still contains "What is Gutenberg?"

output_heading

Paragraph

Same behavior as headings.

List

  1. launch the app
  2. Scroll to the list block containing 5 list items at the bottom of the screen
  3. Tap at the end of the second list item
  4. tap enter key, observe that a new empty list item is created in the third position on the list
  5. tap enter key again, observe that two new list blocks are created, so we now have
    • The original list block containing the first 2 of the 5 items in the original list;
    • An empty paragraph block containing the cursor, but no text; and
    • A new list block containing the last 3 items from the original list.
  6. tap undo, observe the first tap does nothing
  7. tap undo a 2nd time, observe that the empty paragraph block and the second list item block are removed. The original list item block remains, but it only contains the first two items from the list. The 3rd, 4th, and 5th list items have disappeared.
  8. tap undo a 3rd time, observe that the list block has been restored to its original state with 5 list items.

output_list

@SergioEstevao
Copy link
Contributor

I've retested this on the last version and all the issues above look they are fixed.
So blocks are restored the correct status after undo, the only issues I see is the positioning of the cursor after the undo.
But that is mentioned on this ticket here #303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants