Skip to content

Conversation

@ellatrix
Copy link
Member

@ellatrix ellatrix commented Oct 4, 2018

Description

WIP: this relies on #10297!
Also note that this fixes a bug that existed long before the new rich text value!

Fixes #6021. In master, keep enter pressed in a paragraph, and observe blocks with too many BR elements, or nested paragraph elements, or BR elements around existing text. This is caused by attaching the keydown handler too late (during TinyMCE setup), resulting in default browser behaviour executing. The solution is to attach handler on the content editable element with React as soon as the element is created.

How has this been tested?

When keeping enter pressed in a paragraph, it should create a bunch a clean, empty paragraphs.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@ellatrix ellatrix force-pushed the try/fast-enter-fix branch from 5b6bc51 to 9e42c8c Compare October 4, 2018 04:42
@ellatrix ellatrix force-pushed the try/fast-enter-fix branch from 9e42c8c to 0162cba Compare October 4, 2018 04:44
@ellatrix ellatrix added [Status] In Progress Tracking issues with work in progress [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Oct 15, 2018
@ellatrix
Copy link
Member Author

New PR: #11287.

@ellatrix ellatrix closed this Oct 31, 2018
@ellatrix ellatrix deleted the try/fast-enter-fix branch October 31, 2018 08:13
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 [Status] In Progress Tracking issues with work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warning on pressing ENTER fast

2 participants