You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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
@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.
Activity
adumesny commentedon Aug 12, 2026
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
Briix commentedon Aug 25, 2026
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
kollner commentedon Sep 16, 2026
+1 Are there any updates to this. I am in the same situation.
adumesny commentedon Sep 30, 2026
@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.
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.

auto-scroll triggers off the cursor nearing an edge
auto-scrolling on drag now mouse based
auto-scroll triggers off the cursor nearing an edge