Skip to content

Auto scroll option #3356

Closed
Closed

Description

@Briix

Hi,

How would you feel about adding some options for controlling when the auto scroll gets triggered?

We're using gridstack to lay out a configurable widget grid and we're experiencing that people have troubled rearranging the widgets in the grid because the widgets are often somewhat big and easily touch the vertical edges of the container. On top of this we have a sticky header that sits over the grid which is somehow keeping the auto scroll from triggering at the top edge.

I did a bit of experimenting of my own and found that in our case it feels a lot more natural to scroll based on the cursor position instead of the dragged/resized item's boundary box. For us a 20px offset from the cursor (plus a bit to account for the sticky header) was the sweet spot, but I could see this change from project to project.

Would you be open to have an option to set the auto scroll trigger to be based on cursor position, and maybe with optional offset parameters?

Would be happy to contribute the code myself but wanted to check first if this was even something you were interested in having in your library

Thanks :)

Activity

  1. adumesny commented on Aug 12, 2026

    @adumesny
    Member

    having an option seems like a bandaid I rather avoid (and maintain effort nightmare). It's very possible cursor based (like we use for drag&drop using enterEvent which is mouse based) rather than drag object boundary is the better approach, but even drag&drop mouse based which fixed some flickering issues and predictability has it's own issues like #3198

    if you can post a video and sample demo showing issue that would help make a case, and is required for me to even consider

  2. Briix commented on Aug 25, 2026

    @Briix
    Author

    Apologies for the slow reply, but I got around to make a demo of it now. We have some logic in our application frame that I couldn't easily replicate here which seems to cause our issue of not being able to scroll up while dragging a widget, so that's probably something we will look into fixing on our end.

    Regardless though I still believe that for some use cases, like ours, where the user is dealing with relative big grid elements and sometimes smaller laptops it feels less like a dexterity test to rearrange the grid. You can test it out for yourself here https://stackblitz.com/edit/vitejs-vite-mcyz6xnu, and I've tried to record a demo of the functionality also

    Screen.Recording.2026-08-25.at.12.26.24.mov
  3. kollner commented on Sep 16, 2026

    @kollner

    +1 Are there any updates to this. I am in the same situation.

  4. adumesny commented on Sep 30, 2026

    @adumesny
    Member

    @Briix you make a good case why using the cursor might be a better approach in general as more intentional (user explicitly moving to the edge rather than large item happening to stick way out). let me take a look. I don't want an option though.

    sticky header that sits over the grid which is somehow keeping the auto scroll from triggering at the top edge.

    that sticky element really doesn't need to live in the scrollable grid (I see scrollbar next to it) and yet sticks. this complicates GS having to detect that edge case which I would rather avoid. easy for the app to pull that out and only grid container has scroll.
    Image

  5. added 3 commits that reference this issue on Oct 1, 2026
    b850b0d
    650e84f
    0a4109f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions