You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have page that contains a Table of Contents block and we view this page in the site editor, the block also renders the other template headers. I'm not sure if this is something known and if is something wrong with how the headings are assigned to that block.
This might be serious enough because of the side effects of the block to update its attributes based on existing static markup and the discovery method it uses to find headings. In such a case if we render the template in a BlockPreview, it crashes the browser. It was discovered here. It seems that by using getClientIdsWithDescendants when we are in site editor has unexpected results.
Step-by-step reproduction instructions
In a page add a heading and a TOC block.
View that page in site editor
Edit the template and add some more headers
View the page again
Observe that the TOC inside the Post Content block also renders the template's headings.
Screenshots, screen recording, code snippet
Screen.Recording.2023-09-12.at.5.19.49.PM.mov
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Description
If we have page that contains a Table of Contents block and we view this page in the site editor, the block also renders the other template headers. I'm not sure if this is something known and if is something wrong with how the
headingsare assigned to that block.This might be serious enough because of the side effects of the block to update its attributes based on existing static markup and the discovery method it uses to find
headings. In such a case if we render the template in a BlockPreview, it crashes the browser. It was discovered here. It seems that by using getClientIdsWithDescendants when we are in site editor has unexpected results.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Screen.Recording.2023-09-12.at.5.19.49.PM.mov
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes