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

Document Outline: Exception caused by headings with formatting #8160

Closed
noisysocks opened this issue Jul 24, 2018 · 1 comment
Closed

Document Outline: Exception caused by headings with formatting #8160

noisysocks opened this issue Jul 24, 2018 · 1 comment
Assignees
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Milestone

Comments

@noisysocks
Copy link
Member

noisysocks commented Jul 24, 2018

Describe the bug
A heading with rich text formatting causes the Document Outline to throw an exception.

To Reproduce

  1. Go to the Gutenberg Demo post
  2. Click on the Content Structure button (the i icon in the upper left)

or

  1. Create a new post
  2. Insert a heading block
  3. Type some text
  4. Make some of the text bold
  5. Click on the Content Structure button (the i icon in the upper left)

An exception is thrown:

Uncaught Error: Objects are not valid as a React child (found: object with keys {type, props}). If you meant to render a collection of children, use an array instead.
    in span (created by TableOfContentsItem)
    in button (created by TableOfContentsItem)
    in li (created by TableOfContentsItem)
    in TableOfContentsItem (created by DocumentOutline)

Expected behavior
The document outline should be shown.

Additional context
In #7934, we changed how attributes with a source of children are serialised. We likely need to update DocumentOutline to respect this new object shape by e.g. using <RichText.Content>.

@noisysocks noisysocks added the [Type] Bug An existing feature does not function as intended label Jul 24, 2018
@noisysocks noisysocks added this to the 3.4 milestone Jul 24, 2018
@designsimply designsimply added the [Feature] Blocks Overall functionality of blocks label Jul 24, 2018
@jorgefilipecosta jorgefilipecosta self-assigned this Jul 25, 2018
@designsimply
Copy link
Member

Closed #8150 as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants