-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cdk drag: add ability to update internal _activeTransform #18530
Comments
That was one of the purposes of the |
Looks like updating |
Is there a way to update cdkDragFreeDragPosition with method? I'm trying not to trigger change detection.. Edit: this looks like it's working, gonna test it some more if (this._scrollbarSize.y) {
this.trackYRef.nativeElement.style.transform = `translate3d(0, ${this._scrollbarPosition.y}px, 0)`;
this.cdkDragYRef._dragRef.setFreeDragPosition({ y: this._scrollbarPosition.y, x: 0 });
// (this.cdkDragYRef as any)._dragRef._activeTransform.y = this._scrollbarPosition.y;
}
if (this._scrollbarSize.x) {
this.trackXRef.nativeElement.style.transform = `translate3d(${this._scrollbarPosition.x}px, 0, 0)`;
this.cdkDragXRef._dragRef.setFreeDragPosition({ x: this._scrollbarPosition.x, y: 0 });
// (this.cdkDragXRef as any)._dragRef._activeTransform.x = this._scrollbarPosition.x;
} |
I'm closing this @crisbeto, I'd suggest naming cdkDragFreeDragPosition something more descriptive and adding a What do you think, should I make a PR (for that method at least, that rename would probably be breaking change not work doing right now I guess..)? |
I agree that the name isn't great, but I couldn't come up with anything more descriptive. Regarding the method, won't it be a little redundant? The input basically calls directly into it. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds method `setFreeDragPosition` in Cdk `DragDrop` directive to set position in pixel on a drop container. Fixes angular#18530
Adds method `setFreeDragPosition` in Cdk `DragDrop` directive to set position in pixel on a drop container. Also corrects some inaccurate types on a couple of freeDragPosition methods of the `DragDrop` directive. Fixes angular#18530
Adds method `setFreeDragPosition` in Cdk `DragDrop` directive to set position in pixel on a drop container. Also corrects some inaccurate types on a couple of freeDragPosition methods of the `DragDrop` directive. Fixes #18530
I want to use
cdkDrag
for the dragging part of a custom scrollbar. But the thing is, the native scroll occurs, I apply transform3d to the custom scrollbar thumb, which is simultaneously the drag handle, now when I try to drag after scroll occurred, those transforms get all messed up.So ideally I would like to be able to sync those values.
This works:
The text was updated successfully, but these errors were encountered: