Skip to content
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

List view drag and drop - make it possible to drop at all levels of the hierarchy #33678

Closed
Tracked by #33683
talldan opened this issue Jul 26, 2021 · 5 comments · Fixed by #49742
Closed
Tracked by #33683

List view drag and drop - make it possible to drop at all levels of the hierarchy #33678

talldan opened this issue Jul 26, 2021 · 5 comments · Fixed by #49742
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks [Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Type] Bug An existing feature does not function as intended

Comments

@talldan
Copy link
Contributor

talldan commented Jul 26, 2021

Description

At the moment, there's a known issue when dragging and dropping in List View. It's only possible to drag a block where there's an adjacent block at the position you wish to drop to.

For example, in the following structure, a paragraph can't be moved to after the group because the drag and drop system uses the presence of other blocks to determine the drop target:
Screenshot 2021-07-26 at 1 46 11 pm

Technically this is difficult to achieve because List View is currently implemented as a flat table.

Step-by-step reproduction instructions

  1. Create a nested block structure with no blocks after the parent block
  2. Try dragging and dropping one of the nested blocks after the parent

Expected behaviour

It should be possible to drop a block after the parent

Actual behaviour

This isn't possible if the parent block is the last block in a list, only when there's another a block after the parent block

Video

CleanShot.2022-02-24.at.13.14.55.mp4
@talldan talldan added [Type] Bug An existing feature does not function as intended [Feature] Drag and Drop Drag and drop functionality when working with blocks [Feature] List View Menu item in the top toolbar to select blocks from a list of links. labels Jul 26, 2021
@jasmussen
Copy link
Contributor

Google Keep has a somewhat unique handling of nested items, which could potentially inspire some behaviors in the list view. Specifically it embraces the fact that it's a list, as opposed to a complex layout as is seen in the canvas. Nesting an item simply requires you to use the drag handle and pull it rightwards, literally indent it with the gesture:

list handling

Similarly, moving a nested item leftwards, literally un-indenting it with a gesture, un-nests it.

This assumption that dragging an item rightwards is an intent to nest an item under the preceeding item likely can't translate 1:1 to a list of actual blocks with content, but sharing in case it inspires adjacent ideas.

@zaguiini
Copy link
Member

It's not only un-nesting... It's also not possible to move a block to the end of a group. It always becomes a child of the last node, instead of becoming the last node itself. It sounds confusing, so let me add a recording:

Screen.Recording.2021-12-15.at.16.02.05.mov

Look how I can make Group the previous sibling of Layout Grid, but I cannot make Layout Grid the next sibling of Group. It always ends up inside Group.

@talldan
Copy link
Contributor Author

talldan commented Dec 16, 2021

Thanks @zaguiini, yes that's another instance of the issue. It's hard to describe!

@talldan talldan changed the title List view drag and drop - improve un-nesting blocks List view drag and drop - make it possible to drop at all levels of the hierarchy Feb 25, 2022
@skorasaurus
Copy link
Member

skorasaurus commented Aug 10, 2022

Been wondering about this for a while, I thought I was doing something wrong because I couldn't figure out how to do that; relatively frustrating and still present in Gutenberg 13.8.1

@andrewserong
Copy link
Contributor

I've opened a potential fix over in #49742 to explore this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks [Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants