-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
WIP: Fix infinite render of pattern block from call to setBlockEditingMode
#63928
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @htmgarcia. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
if ( select.getBlockEditingMode( clientId ) === mode ) { | ||
return; | ||
} |
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 is what fixes the bug.
? 'disabled' | ||
: undefined | ||
); | ||
registry.batch( () => { |
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.
I figured this should use registry.batch
? Was it originally an oversight or is it unnecessary?
@@ -74,18 +74,19 @@ const useInferredLayout = ( blocks, parentLayout ) => { | |||
}, [ blocks, parentLayout ] ); | |||
}; | |||
|
|||
function setBlockEditMode( setEditMode, blocks, mode ) { | |||
function updateInnerBlocksEditingMode( blocks, mode, setBlockEditingMode ) { |
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.
I made some other changes here, as I found the naming of this function (which was very similar to setBlockEditingMode
) too confusing to read. Also made some other small readability changes.
Actually, this doesn't fix it, it's just that I'd messed up dispatching the action. |
Size Change: +46 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
setBlockEditingMode
setBlockEditingMode
What?
WIP
Fixes #63909
Why?
How?
Then follow these steps:
In trunk: The pattern and verse block infinitely re-render causing the editor to hang
In this PR: The editor is usable