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

Unreliable drag & drop (blue line) indicator #32880

Closed
kevin940726 opened this issue Jun 22, 2021 · 8 comments
Closed

Unreliable drag & drop (blue line) indicator #32880

kevin940726 opened this issue Jun 22, 2021 · 8 comments
Assignees
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks [Type] Bug An existing feature does not function as intended

Comments

@kevin940726
Copy link
Member

kevin940726 commented Jun 22, 2021

Description

I did search but couldn't find other issues specific about this, so decided to open one. Feel free to link other related issues or close this one. (I intentionally make the title of this issue vague so that we can gather as many cases as possible here. We can treat it as an overview issue of anything related to the blue line indicator.)

The drag&drop (blue line) indicator is unreliable and pretty wonky, providing bad user experience. I'm still unsure how it works, sometimes it shows but sometimes it doesn't. I've recorded some basic interactions when dragging a block in the post editor:

Kapture.2021-06-22.at.16.53.34.mp4

Below are some bugs I noticed, in the order shown in the video above:

  1. The indicator flickers when dragging on a block.
  2. There's no indicator shown when trying to drag it above the first block.
  3. There's no indicator shown when trying to drag it below the last block either. It only shows when the cursor is within a very small range below the last block.
  4. There's no indicator shown when trying to drag it to an empty block list (Inner Blocks). (Related: Unable to drag a widget from one sidebar to the second when the last is not selected #32652)

Currently, the indicator is positioned with both the prevBlock and the nextBlock. It makes sense when the indicator is in between blocks, but not so much in other cases (2),(3),(4). I think we might have to rethink the approach and come up with a way that doesn't depend on existing blocks in those cases. An approach just came to my mind would be to insert invisible placeholder blocks to the block list, so that we can position the indicator between them.

Here's another UX issue when trying to drag a block into inner blocks.

Kapture.2021-06-22.at.20.59.04.mp4
  1. It's unclear in the UI that whether it will be dragging into the Columns block or append after the Columns block. The UI is the same, a long blue line, just that the position is slightly different.
  2. As you could probably notice in the screencast above, the scroll container scrolls when dragging the block. It helps the user to move the block outside the current viewport, but the scrolling is happening too early imo. It should only happen when the cursor is below or above a certain threshold, or in other words, follow the OS behavior when moving things if possible.

Step-by-step reproduction instructions

  1. Create a new posts and insert some blocks and inner blocks.
  2. Try to move a block.

Expected behaviour

The blue line indicator should show reliably.

Actual behaviour

The blue line indicator doesn't show reliably.

WordPress information

  • WordPress version: master
  • Gutenberg version: trunk
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes

Device information

  • Device: Desktop
  • Operating system: macOS
  • Browser: Safari 14.1
@kevin940726 kevin940726 added the [Type] Bug An existing feature does not function as intended label Jun 22, 2021
@mtias
Copy link
Member

mtias commented Jun 23, 2021

There was some recent work done here: #31896

cc @ellatrix

@talldan
Copy link
Contributor

talldan commented Jun 28, 2021

#32776 may also have fixed some inconsistencies.

There's no indicator shown when trying to drag it above the first block.

#33024 should fix this.

There's no indicator shown when trying to drag it below the last block either. It only shows when the cursor is within a very small range below the last block.

The mouse has to be within the block list element presently. It'd be nice to improve this.

@talldan
Copy link
Contributor

talldan commented Aug 11, 2022

As mentioned on #43127, it looks like the fix in #33024 has regressed, the indicator no longer shows above the first block.

edit: Now fixed in #43135.

@aaronjbaptiste
Copy link

Thanks for the fix, tested and working great for vertical stacks, but as commented on #43135, it doesn't appear before the first block for horizontal layouts.

@talldan
Copy link
Contributor

talldan commented Sep 7, 2022

Thanks for mentioning it. I'll take a look.

Also worth mentioning that the Buttons block is really messed up, that still shows vertical drop indicators 😬

@talldan
Copy link
Contributor

talldan commented Sep 7, 2022

That was a fairly easy fix - #43944. I'll add some end to end testing for this as well before making it ready for code review.

@ellatrix
Copy link
Member

ellatrix commented Jul 8, 2024

Is this still an issue? Seems some problems were fixed? Should it be closed in favour of #44064?

@mtias
Copy link
Member

mtias commented Aug 2, 2024

Yeah, let's close

@mtias mtias closed this as completed Aug 2, 2024
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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants