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.
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
Grid interactivity: Allow blocks to be positioned in manual mode using drag and drop #61025
Grid interactivity: Allow blocks to be positioned in manual mode using drag and drop #61025
Changes from 12 commits
539bb86
37ff369
b3e7d95
eb732d1
6b72367
73b821a
9dff09b
eef95b2
ef056c1
ca959da
4ac5e9d
881af91
5f6e8d7
249549b
86f0c1c
fa2b066
28ab6b9
29e97e1
e2b2897
b79494d
81623d5
2b2e16a
9621ddb
2062300
f1141af
3455e3c
51de6e8
f1f82b2
c12b098
c80ce4d
d982fdf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can we disable block movers here without referring to layout at all?
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.
Yeah, I can't really think of an alternative approach.
Maybe if we had a more flexible way of disabling moving than the existing locking APIs. Then we could have the
layout
block-supports call an API to lock moving. But I don't think it's worth adding that just for this feature.Should we use
useLayout
though instead of reading the attributes directly? I can't remember what benefituseLayout
provides, if any.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.
useLayout
doesn't return the correct layout type here; it only ever returns "default" in my testing. I don't think this component has access to the context fromBlockListItems
, which is whatuseLayout
returns.If it did work, the benefit would be accessing the parent layout type through context instead of a selector.
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.
Welp, had to add a bunch of hooks here to be able to move the blocks in the markup order 😅
Not sure if there's a better way of doing this. A possible alternative would be not exposing these controls in the sidebar at all (which would mean keyboard manipulation would depend exclusively on the block movers, maybe not ideal)