-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Edit Post: Prevent rendering self also when the wrapper block matches the inserted block #31592
Conversation
039f7d3
to
493cfaf
Compare
Size Change: +127 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
const previouslyRenderedBlocks = useContext( RenderedRefsContext ); | ||
const { name: blockName } = useBlockEditContext(); | ||
const { name } = useBlockEditContext(); | ||
blockName = blockName || name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a nice idea to cover it with a unit test. I will explore options next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solves the issue Grzegorz - thanks 💯
I believe the failing test is not related but haven't checked in depth.
Did you re-trigger some CI jobs? I don't see errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Did you re-trigger some CI jobs? I don't see errors.
I did and indeed they were not related :)
Description
Reportes by @ntsekouras in #31455 (comment):
How has this been tested?
Create a post and insert a Post Content block there.
Convert a block(s) into a Reusable block. Go to Manage Reusable Blocks page and start editing one of them. Insert the same Reusable block into self.
It should not render only the warning as presented below.
Screenshots
Reusable block inserted when editing the post for the same reusable block:
Post Content inserted when editing the same post:
Types of changes
Bug fix (non-breaking change which fixes an issue).
Checklist:
*.native.js
files for terms that need renaming or removal).