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

Block Hooks: Fix toggle #57956

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/block-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function BlockHooksControlPure( { name, clientId } ) {
}

const hookedBlock = candidates?.find(
( candidate ) => name === candidate.name
( candidate ) => candidate.name === block.name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of before and after insertion, all children of the current anchor block's parent are candidates; we need to compare them to the hooked block's name (block.name), rather than the anchor block's name (which will always be true, as the anchor block is of course also a child of its own parent).

);

// If the block exists in the designated location, we consider it hooked
Expand Down
Loading