Pressing enter too quickly can result in paragraphs within paragraphs #10272
Labels
[Feature] Rich Text
Related to the Rich Text component that allows developers to render a contenteditable
[Type] Bug
An existing feature does not function as intended
[Type] Performance
Related to performance efforts
Describe the bug
A paragraph block should never contain a child paragraph.
If you press enter too quickly in succession, you can end up with paragraphs inside paragraphs. These act weirdly with delete and backspace, and cause tests to fail.
This is also the cause of the intermittent test failure in
e2e/specs/splitting-merging.js
To Reproduce
Start a new post.
In the console, enter this code so you can see the internal state of the post:
Focus the post and press enter 5 times in quick succession. 🔨 it!
If your system is as slow as mine, you'll see multiple new paragraph blocks, but some of them will not have the
Add text...
placeholder. Those paragraph blocks contain a child paragraph that's empty.Check the console and you'll see the malformed blocks.
This causes an intermittent test failure in
e2e/specs/splitting-merging.js
sometimes inshould remove at most one paragraph in forward direction
because that test presses enter three time in quick succession.The text was updated successfully, but these errors were encountered: