-
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
Fix: Block Movers appear when content block is immediate child of a section. #67651
base: trunk
Are you sure you want to change the base?
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 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. |
Size Change: +15 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Thanks for the PR @jorgefilipecosta. Unfortunately this approach removes the movers from inner blocks of the Post Content when editing a page in the template locked mode: I think these inner blocks have the default block editing mode or something and so the expectation is they can be moved. Maybe the solution is to check whether both the parent and the child are |
Maybe this will work, I'm not sure, there are lots of inconsistencies with block editing modes:
This makes me pause on whether there should be any logic about the In hindsight, I'm not sure 'disabled' should be a block editing mode because of the inconsistency in how it works. Maybe it should be a separate API like |
72b9634
to
1e50d7e
Compare
Hi @talldan, good catch, I applied your suggestion "check whether both the parent and the child are contentOnly and only then hide the movers" and it seems to work well. It also makes logic sense if the parent and the block itself are content only I don't see a reason for moving to be possible. |
Flaky tests detected in e5f1422. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12519731056
|
I think that change prevents moving sections in Zoom Out and Write Mode, since sections are set to Sorry, I should've thought of that when making the suggestion initially! |
1e50d7e
to
d090fca
Compare
2b4129a
to
e5f1422
Compare
Hi @talldan this is very tricky thank you for all the debugging. I updated the PR to reduce the scope and fix just one of the cases that I think is safe. Pasting the following markup we should not have movers inside the paragraph:
On trunk the movers appear on this branch they do not appear. |
Currently, the movers appear unexpectedly when a content block is the immediate child of a content-locked block or the immediate child of a section and the editor is in write mode. This PR fixes both cases.
cc: @talldan
Testing Instructions
I created a new page with the following markup (pasted on the code editor).
I switched to write mode and I verified I could not move the paragraphs.
I created a new post with the following markup:
I verified I could not move the paragraphs.