Currently, I am working on implementing a straightforward drag and drop feature.
When dragging an item, my goal is to scroll the containing div by a specified amount in either direction.
To achieve this, I am utilizing Angular Material's CDK drag and drop functionality.
The container element looks like this:
<div cdkDropList (cdkDropListDropped)="dropElement($event)" #ordersList>
I am accessing the container along with its elements using the following code:
@ViewChild('ordersList', {read: ElementRef}) ordersListRef: ElementRef;
Unfortunately, trying to adjust the scroll position of this element using code like this doesn't seem to have any effect:
this.ordersListRef.nativeElement.scrollTop += 20;