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

[drag-and-drop] Visual cue for dropping element shown in another block's inner content even when dropping isn't possible #24174

Closed
Tracked by #33683
fullofcaffeine opened this issue Jul 23, 2020 · 2 comments · Fixed by #56843
Assignees
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks Needs Design Needs design efforts. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@fullofcaffeine
Copy link
Member

fullofcaffeine commented Jul 23, 2020

Describe the bug

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:

  1. Create a post with multiple blocks including Contact Info and Slideshow blocks
  2. Make sure you have text in the Contact Info block’s inner paragraph for visual reference
  3. 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

Screencast
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):

  • OS: Linux Mint 18.4
  • Browser: Firefox Quantum
  • Version: 79.0b9
@talldan talldan added [Feature] Drag and Drop Drag and drop functionality when working with blocks [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. labels Jul 24, 2020
@talldan
Copy link
Contributor

talldan commented Jul 24, 2020

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.

@zaguiini
Copy link
Contributor

zaguiini commented 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:

  • Change the cursor to not-allowed;
  • Change the color of the drop space from blue to red.

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 Needs Design Needs design efforts. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants