-
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
Stop unwanted drag and drop operations within section Patterns in Zoom Out mode #64331
Stop unwanted drag and drop operations within section Patterns in Zoom Out mode #64331
Conversation
Size Change: +3.21 kB (+0.18%) Total Size: 1.77 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. |
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.
This is working as expected and it's covering for cases that we were not anticipating before. Let's bring this in. Great work!
What?
Blocks the ability to drag patterns inside existing top level patterns in Zoom Out mode. Patterns should only be insertable at the top level.
Also disable ability for horizontal insertion at the topmost level.
Closes #63862
Why?
Zoom Out is about composing Pages from Patterns as sections. These "sections" are the building blocks of the page. As a result when constructing a page using drag and drop it is confusing if
Both of these interactions also make the experience prone to error.
What we need is for the top level sections to be selectable (
blockEditingMode === 'default'
) but to disable the ability to drag and drop inside of them. This is a hybrid state, specific to Zoom Out mode, which means we need to add special conditions.In addition to this, drag and drop interactions can have an "operation" which can be
insert
orgroup
. Insert is standard "insert block(s) here". Group however, is for special interactions such as allowing for the creation of "Row" layouts by dragging one group to the left/right of another group.In Zoom Out mode we are composing sections and thus such "grouping" operations are undesirable.
How?
Change the order of the conditionals that govern the availability of drop zones, so that when in Zoom Out mode, all dropzones (except those at the section root) are disabled. This means that you cannot drag and drop inside the individual section blocks, but you can drag and drop between them.
Moreover, we hide the insertion points at the topmost level if/when the drag/drop operation type is
group
.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
Screen.Capture.on.2024-08-08.at.10-38-22.mp4
After
Screen.Capture.on.2024-08-08.at.10-28-03.mp4
Co-authored-by: Maggie Cabrera 3593343+MaggieCabrera@users.noreply.github.com
Co-authored-by: scruffian scruffian@git.wordpress.org