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

Merging blocks after split causes crash #1034

Closed
mkevins opened this issue May 27, 2019 · 1 comment
Closed

Merging blocks after split causes crash #1034

mkevins opened this issue May 27, 2019 · 1 comment
Labels

Comments

@mkevins
Copy link
Contributor

mkevins commented May 27, 2019

Description

The editor crashes when merging blocks after splitting. This is very similar and may be a partial regression of #921, which was fixed by #949.

This seems to be fixed by #1032, however, it is difficult to follow why this is the case.

In the diff, isSelected can be set from true to false (but not false to true) based on the conditions here: https://github.com/WordPress/gutenberg/pull/15833/files#diff-4828a21853e899e5a36faecfa96d83e8L926. I suspect setting isSelected to false alters the control flow in other areas of the code, resulting in an invalid state, but I have not invested enough time to explore that.

Steps to reproduce

  1. Place caret in paragraph block.
  2. Press [Enter] to split block.
  3. Tap the beginning of the second split block to place the caret there.
  4. Press [Backspace] to merge the blocks.

Expected

The blocks should merge into one.

Actual

The editor crashes 💥

Screenshot

@mkevins
Copy link
Contributor Author

mkevins commented May 29, 2019

Closing this, as it has been resolved by #1032.

@mkevins mkevins closed this as completed May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant