-
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
Drop patterns and blocks between sections only in zoom out mode #60828
Merged
draganescu
merged 4 commits into
trunk
from
add/remove-drop-zone-for-sections-in-zoom-out
Apr 22, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
440e289
in zoom out mode remove the drop zone for the sections
draganescu 83b7572
Update packages/block-editor/src/components/inner-blocks/index.js
draganescu 50c0e2e
Update packages/block-editor/src/components/inner-blocks/index.js
draganescu 7a372d1
Update packages/block-editor/src/components/inner-blocks/index.js
draganescu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thought we changed the block editing mode to account for this? Why do we need to change it here as well? Is this a bug? https://github.com/WordPress/gutenberg/pull/59249/files#diff-aa92c48095c35f17feb834dd919baf52274a73c7b1180ff5acce7b6087b126cfR2923
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 wondered the same.In that file we disable all blocks that are NOT sections, NOT the container (content only), not the block root (disabled). The sections are default. So that means, we need to manually disable the drop zone for each section because the mode is default.
It's easy to see in trunk: one can drop just at immediate 1st level of a pattern but not in nested block levels.
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.
Shouldn't we disable the section blocks?
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.
we can't select them if they're disabled.
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.
🤔 if you disable a block you should still be able to select it? For what use case does it behave that way? If you want to disable selection, you should disable the whole block list imo
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.
We do disable the whole block list if there is a section root.
So the case is:
This is what this code accomplishes.
See #51148 how it specifically "Disable selection (using user-select: none) in disabled blocks."