-
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
Fix: Remove parent block selector while in Write mode #67395
Fix: Remove parent block selector while in Write mode #67395
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. |
@jorgefilipecosta, #65577 seems something that can be implemented here as well |
Size Change: -22 B (0%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
fe1fae7
to
15cd4bf
Compare
Hi @Mamaduka, I think this PR also fixes #65577, if a pattern is content-locked now we don't render the parent selector when inside that parent. |
@Mamaduka would you be able to review this PR 😊? |
@jorgefilipecosta, it's on my list, and I will do a proper review first thing tomorrow morning. |
getBlockEditingMode( selectedBlockClientId ) !== | ||
'contentOnly' && |
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 add this condition to the PrivateBlockToolbar
component. It already has the same logic, and we're just duplicating it here. That will also void adding the has-parent
class to the toolbar and fix its position.
gutenberg/packages/block-editor/src/components/block-toolbar/index.js
Lines 134 to 143 in ce00a5f
showParentSelector: | |
! isZoomOut() && | |
parentBlockType && | |
getBlockEditingMode( parentClientId ) !== 'disabled' && | |
hasBlockSupport( | |
parentBlockType, | |
'__experimentalParentSelector', | |
true | |
) && | |
selectedBlockClientIds.length === 1, |
Also, we can remove the isVisible
logic from this component since the check already happens parent.
Screenshot
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.
Thank you @Mamaduka good point, your feedback was applied.
15cd4bf
to
c79a28d
Compare
c79a28d
to
d9fbc25
Compare
getBlockEditingMode( selectedBlockClientId ) !== | ||
'contentOnly' && |
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.
Nit (non-blocking): the block editing mode for the selected one is already available here. See the editingMode
variable above.
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.
Updated in 8a0be0e.
Flaky tests detected in d9fbc25. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12184363069
|
Fixes: #66684
Fixes: #65577
Removes the parent selector while in write mode.
cc: @richtabor
Testing Instructions
Enable the write mode under experiments.
Change the post to write mode.
Add a pattern e.g: a call to action.
Select a paragraph block and verify the parent selector is not available.