Skip to content

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

Closed

Description

@fullofcaffeine

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

Activity

  1. added
    [Feature] Drag and Drop
    [Type] Enhancement
    Needs Design
    on Jul 24, 2020
  2. talldan commented on Jul 24, 2020

    @talldan
    Contributor

    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.

  3. zaguiini commented on Jan 4, 2022

    @zaguiini
    Member

    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.
  4. added
    [Status] In Progress
    on Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Needs Design[Feature] Drag and Drop[Status] In Progress[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions