Bug / Feature request
When dragging an item with cdkDrag attribute, user should be able to use mouse wheel to scroll down the page, or the page should scroll down automatically if the draggable list longer than current page's height.
Mouse scroll on page is not working when dragging an item.
A) Goto https://material.angular.io/cdk/drag-drop/overview
Click on Draggable square in Basic Drag&Drop (Getting started section). While holding left mouse button pressed, try to scroll the page down with mouse wheel or touchpad.
B) Click on Draggable list item in Drag&Drop sorting (Reordering lists section). Make sure that half of the list is not visible in viewport. Click on any item and start dragging it to the bottom of the list. Again, mouse wheel scroll is not working, neither the page gets scrolled down automatically when you try to drag item down the list.
This is Accessibility related issue and should be working to get the best user experience.
Angular 7.
If you check React's draggable component here (https://react-beautiful-dnd.netlify.com/?selectedKind=single%20vertical%20list&selectedStory=basic&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel) you should get a better understanding of the expected Accessibility feature. Drag the top item to the bottom of the list and see how the page scrolls down. Mouse wheel scroll is also working fine.
Currently scrolling is disabled intentionally. It'll be enabled once https://github.com/angular/material2/issues/13588 is resolved.
Does not seem that anyone is solving #13588. @crisbeto any ideas when this is gonna be enabled/fixed?
any progress on this issue?
Angular 8 CDK release adding this support? drag and drop inside scroll container
Any update here?
This is real show stopper for us as our webapp shows a lot of data and with Dragular2 its no problem to scroll also while dragging. We had to cancel our (almost complete) migration to Material Drag because of this Bug, please fix it soon if possible :/
Hi i have tried using this library for my projects ngx-smooth-dnd. Work really well with dnd support and drag on scroll as-well. I have made a sample demo app here https://github.com/sandeepsuvit/angular-dnd-survey-creator
. Here is a working demo of the app that i created using ngx-smooth-dnd
. Hope this helps someone until this issue is fixed :)
BUMP
This bug really is a deal breaker in the Angular Material CDK...
Any update on this? https://github.com/angular/components/issues/13588
Any news?
Any update ?
Any update?
If I'm reading the chain properly:
In issue #13588 it references PR #16382 that was closed on July 9th. So this should be in 8.1.0 and above.
Hoping this helps.
any updates?
any updates?
Still having same issue, is there a way to enable scrolling while dragging??
any updates?
I also wonder what changed as dragging while scrolling worked after the update, but now it started happening again - scrolling while dragging somehow offsets the row position so it's not possible to drag item to correct position after scroll has be initiated.
This is not happening on the sample https://material.angular.io/cdk/drag-drop/overview, but I'm still wondering what could be the cause of this..
So, if anyone still has issues with this I can share solution I found and it's super strange it's not clearly documented.
Let's say you have a list and you want to implement DnD with autoscroll for it:
<div class="scrollable-content" cdkScrollable>
<ul cdkDropList>
<li cdkDrag *ngFor="let item of items"></li>
</ul>
</div>
The important thing here is cdkScrollable
on scrollable container. It can be far ancestor (in our case it's like that) and not direct parent.
To summarize, to enable autoscroll you need to import CdkScrollableModule
and set cdkScrollable
for scrollable container which should scroll on drag.
So, if anyone still has issues with this I can share with solution I found and it's super strange it's not clearly documented.
Let's say you have a list and you want to implement DnD with autoscroll for it:
<div class="scrollable-content" cdkScrollable> <ul cdkDropList> <li cdkDrag *ngFor="let item of items"></li> </ul> </div>
The important thing here is
cdkScrollable
for scrollable container. It can be far ancestor and not direct parent (in our case it's like that).To summarize, to enable autoscroll you need to import
CdkScrollableModule
and setcdkScrollable
for scrollable container which should scroll on drag.
So for me the import was actually
import {ScrollingModule} from '@angular/cdk/scrolling';
Here's the docu: https://material.angular.io/cdk/scrolling/api ( not mentioning DragDrop though)
Most helpful comment
any progress on this issue?