Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

Drag + wheel scroll feature

Open NGorco opened this issue 8 years ago • 21 comments

I want to scroll page while dragging element. But while dragging mouse wheel not firing 'scroll' event. How to recreate that feature like in jQuery?

https://jqueryui.com/draggable/#scroll

NGorco avatar Aug 18 '16 16:08 NGorco

Confirm. This feature is available in JQuery sortable and very useful when you have a large page based on drag and drop interface (like Trello or page builder) and you need to drag elements across the page.

lumberman avatar Aug 18 '16 16:08 lumberman

I had the same issue and it seems the dragula library did as well. This may help: https://www.npmjs.com/package/dom-autoscroller.

TheHollidayInn avatar Nov 03 '17 16:11 TheHollidayInn

any updates about that? It's very important in my projects :-(

gmatkowski avatar Dec 01 '17 14:12 gmatkowski

@TheHollidayInn can you please share your set up code, how exactly you have used this library?

seyfer avatar Sep 11 '18 08:09 seyfer

yes, the example given for scroll doesn't work in Chrome :cry: http://jsbin.com/tutuzeh/edit?html,js,output

seyfer avatar Sep 11 '18 09:09 seyfer

Also it is being used in VueDraggable library and there we have the same issue: https://github.com/SortableJS/Vue.Draggable/issues/181

geoidesic avatar Nov 07 '18 02:11 geoidesic

Any news on this issue ? or at least a workaround ?

Ikaer avatar Nov 12 '18 07:11 Ikaer

cant find any workaround too =(

sergeevpasha avatar Nov 19 '18 13:11 sergeevpasha

Is this really necessary with the Autoscroll feature?

owen-m1 avatar Nov 19 '18 13:11 owen-m1

@Flame2057 i have like 1000 rows that i can sort, and when I need to drag last item to the top its really a nightmare, scroll and drag will make it super easy

sergeevpasha avatar Nov 19 '18 13:11 sergeevpasha

+1 - any news?

This is seems like a pretty logical and mandatory feature ... I'm very happy with this library over jQuery UI - but this might be a deal breaker as we have big draggable/sortable components on a long page that we're using this for, so it's a bit counter-intuitive at the moment.

wernerb90 avatar Mar 29 '19 07:03 wernerb90

@wernerbarnard @sergeevpasha @Ikaer @geoidesic It seems that the scroll wheel does work if forceFallback: true is specified in the options. If this option is set to false, as is by default, the browser's native drag and drop will be used, and this is what is preventing the scrollwheel from it's normal functionality.

owen-m1 avatar Apr 03 '19 22:04 owen-m1

thanks, that works now =)

sergeevpasha avatar Apr 04 '19 08:04 sergeevpasha

Multi-drag feature is a bit buggy if you set forceFallback:true, it randomly deselects item, sometimes you have to do double click, on page load your first try to select will fail 90%. I have 2 large container and I need to transfer data from each other, so I need both multi-drag and mouse wheel scroll. I need 1 more thing, on event onMove, I'd like to access all items of multi drag, with something similar to onAdd event property items.

Amir-Ravnjak avatar May 14 '19 09:05 Amir-Ravnjak

@Amir-Ravnjak Try increasing fallbackTolerance a bit.

owen-m1 avatar May 17 '19 01:05 owen-m1

Increasing fallbackTolerance makes text being selected when you start dragging.

Amir-Ravnjak avatar May 22 '19 06:05 Amir-Ravnjak

@Amir-Ravnjak I thought on most mobile devices that text is selected after a long touch hold, not by moving the touch. What device are you testing on?

owen-m1 avatar May 31 '19 23:05 owen-m1

I am testing it on PC and laptop, trying to use it with mousewheel

Amir-Ravnjak avatar Jun 03 '19 11:06 Amir-Ravnjak

@Amir-Ravnjak All I can think of now is for you to set user-select: none on the items. This can maybe be solved in a future update.

owen-m1 avatar Jun 03 '19 13:06 owen-m1

Hello, is the drag problem with mouse wheel solved? I use native drag html5 but I can't get it to work with mouse wheel

LeninZapata avatar Dec 23 '21 23:12 LeninZapata

Past 5 years, but it doesn`t work yet :(

pieell avatar May 17 '22 20:05 pieell

On a demo page http://sortablejs.github.io/Sortable/ I'm able to drag and automatically scroll down the page. Closing the issue

NGorco avatar Jun 02 '23 15:06 NGorco

Just tested it again, using the demo page, in Brave, Opera, Edge, Chromium and Firefox, and is not working. Tested on Windows 11, last versions of these browsers. Steps to reproduce:

  1. Start dragging an element
  2. while still dragging try to scroll the page
  3. the page will not scroll

mroeling avatar Jun 03 '23 16:06 mroeling

Facing the same issue. Any work-a-rounds?

oliverkoehler avatar Jun 06 '23 11:06 oliverkoehler

If this plugin is working with native HTML5 Drag I don't think it's possible to do Scroll when dragging an element. This drag must be changed to one executed by Javascript and is not native to HTML5

LeninZapata avatar Jun 06 '23 14:06 LeninZapata

I am facing the same issue, please reopen the issue.

Toommi avatar Jun 19 '23 15:06 Toommi

This feature is not even working in demo reopen please

pleskyjp avatar Jan 25 '24 08:01 pleskyjp