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

Error when pressing enter on the second line of content with formats #11508

Closed
jorgefilipecosta opened this issue Nov 5, 2018 · 3 comments · Fixed by #11859
Closed

Error when pressing enter on the second line of content with formats #11508

jorgefilipecosta opened this issue Nov 5, 2018 · 3 comments · Fixed by #11859
Assignees
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 [Type] Bug An existing feature does not function as intended

Comments

@jorgefilipecosta
Copy link
Member

Describe the bug
Pressing enter on the middle of the content in a nonfirst paragraph of content in a quote with a custom format e.g.: bold errors in the console instead of creating a new line.
To Reproduce
Steps to reproduce the behavior:

  1. Create a new post.
  2. Add a quote block.
  3. Write 'aaaaa' as the first line of content and 'bbbbbb' as the second line of content.
  4. Make the second line ( 'bbbbbb' ) bold.
  5. Put the cursor in the middle of the line and press enter.
  6. Verify a new line is not created and the following error appears on the console:
react-dom.min.82e21c65.js:144 Uncaught TypeError: Cannot read property 'slice' of undefined
    at normalise-formats.js:21
    at Array.forEach (<anonymous>)
    at normaliseFormats (normalise-formats.js:17)

Expected behavior
A new line is created.

Screenshots
nov-05-2018 19-57-48

@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Nov 5, 2018
@jorgefilipecosta jorgefilipecosta added this to the 4.4 milestone Nov 5, 2018
@jorgefilipecosta jorgefilipecosta added the [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable label Nov 5, 2018
@LZL0
Copy link

LZL0 commented Nov 6, 2018

This should be in 4.3

@ellatrix
Copy link
Member

Done in #11859.

@mtias mtias added the [Status] In Progress Tracking issues with work in progress label Nov 14, 2018
@mtias mtias modified the milestones: 4.4, WordPress 5.0 RC Nov 14, 2018
@jorgefilipecosta
Copy link
Member Author

Thank you @iseulde!

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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants