I'm using "@angular/cdk": "^15.2.4"
and having difficulties figuring out how to resolve the problem in the title.
That is, I have some parent DOM element coming from an external library that gets a transform: translate3d();
applied, and I have some draggable elements inside that element using CDK's dragdrop feature. When start dragging, the drag helper element gets a position: fixed !important
style, its top and left properties are set to 0, and its dragging position is applied via transform: translate3d()
as well.
The problem is, due to the translate3d
on the parent element, the draggable's position: fixed
causes the containing block for the dragging element will be that particular parent, instead of the whole HTML element, which I think is the base of calculations for the translate3d()
operation on the draggable element.
It seems like CDK's drag does not consider if there's a parent element with a transform property set, which results in wrong numbers being calculated for transformation.
Does anyone have an idea how could I overcome this?
I was trying to set transform:none
and playing around with position
s but no luck so far. I can think of a JS solution of recalculating the translate values manually, but I'd be curious if there's a simpler way to do this.