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

Page-content template part descends forever in Visual mode #61

Closed
bobbingwide opened this issue Apr 8, 2021 · 3 comments
Closed

Page-content template part descends forever in Visual mode #61

bobbingwide opened this issue Apr 8, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Apr 8, 2021

For the following HTML

<!-- wp:group {"backgroundColor":"background","className":"page","layout":{"contentSize":"80%","wideSize":"90%"}} -->
<div class="wp-block-group page has-background-background-color has-background"><!-- wp:post-title {"align":"full","backgroundColor":"light-green-cyan"} /-->

<!-- wp:post-content /--></div>
<!-- /wp:group -->

When viewing the Page content template part in the visual editor it appears that the post-title block is repeated and gets smaller and smaller, until the editor finally gives up with a broken block.
The console log reports:

Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

Removing the post-content block prevents the recursion.
image

image

Gutenberg 10.3.1

@bobbingwide bobbingwide added the bug Something isn't working label Apr 8, 2021
@bobbingwide bobbingwide self-assigned this Apr 8, 2021
@bobbingwide
Copy link
Owner Author

bobbingwide commented Apr 8, 2021

I reproduced the problem with TT1 blocks
What's actually happening is that the post-content block is going recursive.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Apr 13, 2021

I reproduced the problem with the Phoenix theme.

Using the Site Editor I edited the single page and saved the content group as single-content.
Then I tried to edit it from Appearance > Template parts

This animated gif shows the recursion ending with the block failing and the template part's source HTML.

Fizzie issue 61

@bobbingwide
Copy link
Owner Author

Fixed in WordPress 5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant