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

Pressing enter too quickly can result in paragraphs within paragraphs #10272

Closed
notnownikki opened this issue Oct 1, 2018 · 1 comment
Closed
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

Comments

@notnownikki
Copy link
Member

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:

const f = wp.data.select('core/editor');
wp.data.subscribe( () => { console.log( f.getEditedPostContent() ) } );

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 in should remove at most one paragraph in forward direction because that test presses enter three time in quick succession.

@notnownikki notnownikki added [Type] Bug An existing feature does not function as intended [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Performance Related to performance efforts labels Oct 1, 2018
@ellatrix
Copy link
Member

ellatrix commented Oct 3, 2018

Sounds like a duplicate of #6021.

@ellatrix ellatrix closed this as completed Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants