You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[drag-and-drop] Visual cue for dropping element shown in another block's inner content even when dropping isn't possible #24174
Dropping a block onto another block that filters allowed inner blocks doesn’t inform the user as to why the dropped block reverts back to its original position.
To reproduce
Steps to reproduce the behavior:
Create a post with multiple blocks including Contact Info and Slideshow blocks
Make sure you have text in the Contact Info block’s inner paragraph for visual reference
Attempt to drag and drop the Slideshow block into the Contact Info block between the business hours and the paragraph
Expected
The drop indicator line wouldn’t show where I cannot drop the currently dragged block or I would be informed in some manner as to why the dropped block reverted position.
Actual
The line shows and if the block is dropped it just reverts to where it began.
Screenshots
Click the image to open the video
Editor version (please complete the following information):
WordPress version: 5.4.2
Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? gutenberg plugin
If the Gutenberg plugin is installed, which version is it? 8.5.1
Desktop (please complete the following information):
The drop indicator line wouldn’t show where I cannot drop the currently dragged block or I would be informed in some manner as to why the dropped block reverted position.
I feel like the latter might be the best option, not sure exactly what, so I've added the Needs Design label.
Technically I think this can be achieved. I started working on adding Drag and Drop to the Block Navigation/List View feature (#23952), and my approach there is that when the user starts dragging I build up a list of the available drop targets. As it only happens on drag start, it's fairly performant, and it provides the opportunity to be able to do things like work out whether a drop target is valid.
The added complexity is that this should also happen for things like dragging files into the editor, but perhaps easiest just to start with blocks.
Sometimes the user is attempting to perform an impossible action (e.g. trying to add two blocks that can't live together, or trying to nest un-nestable blocks) and there's no feedback at all that the action cannot be done.
That happens on both list view and the editor itself.
Suggestions:
Change the cursor to not-allowed;
Change the color of the drop space from blue to red.
Activity
talldan commentedon Jul 24, 2020
I feel like the latter might be the best option, not sure exactly what, so I've added the
Needs Designlabel.Technically I think this can be achieved. I started working on adding Drag and Drop to the Block Navigation/List View feature (#23952), and my approach there is that when the user starts dragging I build up a list of the available drop targets. As it only happens on drag start, it's fairly performant, and it provides the opportunity to be able to do things like work out whether a drop target is valid.
The added complexity is that this should also happen for things like dragging files into the editor, but perhaps easiest just to start with blocks.
zaguiini commentedon Jan 4, 2022
Sometimes the user is attempting to perform an impossible action (e.g. trying to add two blocks that can't live together, or trying to nest un-nestable blocks) and there's no feedback at all that the action cannot be done.
That happens on both list view and the editor itself.
Suggestions: