angular cdk drag drop - adjust autoscroll speed when dragging
Asked Answered
T

1

12

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

Transliterate answered 1/7, 2020 at 7:41 Comment(1)
R
6

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

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

Redcoat answered 12/10, 2021 at 13:52 Comment(1)
Thx this is what I was looking for! Cheers!Stebbins

© 2022 - 2024 — McMap. All rights reserved.