-
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
Prevent reordering of header and footer template parts when zoomed out #60054
Prevent reordering of header and footer template parts when zoomed out #60054
Conversation
Size Change: -113 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
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 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. |
…s for immediate siblings blocks
38b6c7e
to
bca7a8b
Compare
Good idea I can try |
packages/block-editor/src/components/block-tools/block-selection-button.js
Outdated
Show resolved
Hide resolved
const { name: nextName } = getBlock( nextClientId ); | ||
const nextBlockType = getBlockType( nextName ); | ||
isNextBlockTemplatePart = | ||
nextBlockType?.name === 'core/template-part'; |
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 think we should check if it's a header / footer template area too. This would stop us moving all blocks either side of any template part.
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.
The area check was my initial idea but it's so weirdly saved as a piece of info. Then I realised all template parts should be stuck in place in composer mode.
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.
Tests well; preventing moving of blocks above and below the site header and footer, when in zoom out mode. With another code review opinion, I'm good with it.
It'll come together further when #59249 is merged as well, which will allow for top-level block selection where expected.
WordPress#60054) * don't show movers in zoom out for template parts, try to remove movers for immediate siblings blocks * fix bug because of typo in function name * don't hide the movers, disable them * rename props to be more generic
WordPress#60054) * don't show movers in zoom out for template parts, try to remove movers for immediate siblings blocks * fix bug because of typo in function name * don't hide the movers, disable them * rename props to be more generic
What?
Advances #50739
Why?
To improve the experience of assembling pages and templates using patterns.
How?
Check block type and disable block mover for the block toolbar that appears in zoom out mode.
Testing Instructions
Testing Instructions for Keyboard
N/A
Screenshots or screencast
disable-move-header-footer.mp4