Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular cdk drag drop - adjust autoscroll speed when dragging

UPDATE 11.07.2020

Issue on Github https://github.com/angular/components/issues/19401

ORIGINAL POST

Is there a way to adjust the scroll speed when dragging an item down or up the list? In Firefox on macOS, it behaves as expected, scrolling faster the further down I drag the item. In Chrome and Safari, there seems to be only one speed.

For me, the behavior in Chrome would be most important, since I plan to use drag-drop in an ionic project.

Does anybody know if the scroll is a custom javascript implementation in the CDK or some native browser feature?

Stackblitz

like image 711
Han Che Avatar asked Jul 01 '20 07:07

Han Che


1 Answers

I solved this by using "cdkDropListAutoScrollStep" property of CdkDropList. Requires angular material v11

Documentation here: https://material.angular.io/cdk/drag-drop/api

like image 81
Grebets Kostyantyn Avatar answered Nov 15 '22 12:11

Grebets Kostyantyn