Improve auto-scrolling when components are dragged

Created on 6 September 2024, 3 months ago
Updated 11 September 2024, 2 months ago

Overview

Follow-up to:

🐛 No upward auto-scroll when components are dragged Needs review

See the video that shows the behavior I'm seeing:

https://youtu.be/j46NzjwEfp8

  1. Can't scroll into header area (which I've mentioned before)
  2. There is a very small region that causes scroll (maybe okay?)
  3. The scroll speed for me was very slow in some cases but I couldn't figure out when/why

Proposed resolution

TBD

User interface changes

TBD

📌 Task
Status

Active

Component

Page builder

Created by

🇺🇸United States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

  • Issue created by @Kristen Pol
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
  • 🇳🇱Netherlands balintbrews Amsterdam, NL

    Rewording to better capture that we need improvements in general for the auto-scrolling. See #3 as more input to the issue description.

  • 🇬🇧United Kingdom jessebaker

    Since landing 🌱 [Proposal] A different approach to the iFrame preview interactions Active this issue is improved however I do think there is still room for improvement in that when you drag to the top and bottom of the screen, if your mouse is positioned over either the top bar or zoom controls the scroll behaviour is not invoked.

    I suspect setting pointer events to none on those elements while isDragging is true will resolve the issue.

    Moving to Minor.

  • 🇮🇳India soaratul

    I tried setting pointer-events to none on the top bar and zoom controls while isDragging is true but it did not worked, because actually the scroll starts only when the mouse is approximately 10px close to browser edge(top/bottom) and the top bar and zoom controls are far away.

    I found that top bar and zoom controls actually not causing the misbehave of auto scroll and it's the default browser behaviour(by default auto scroll starts when mouse is very close to edge while dragging), I also found scrollSensitivity and scrollSpeed option used in ui/src/hooks/usePreviewSortable.ts but seems there is no effect of these options and only default browser behaviour is working because these both options works only if forceFallback is set as true, and setting forceFallback as true stops the drag and drop features completely(I didn't investigated further though).

  • 🇬🇧United Kingdom jessebaker

    I think you are correct @soaratul - the default browser behaviour means that the autoscroll is only invoked when dragging and the mouse cursor is < ~15px from the edge of the window. As our top bar and zoom controls are 20px from the edge, then making them have pointer-events:none actually has no impact on the autoscroll.

    Closing as outdated because other changes since this ticket was opened have meant the issue is no longer valid.

Production build 0.71.5 2024