I'm writing an angular 14 app and it contains a div
element that is draggable using cdkDrag
and also has two buttons to scale up or down the div.
so in the component i save a scale
version with default to one, and scale buttons add or dec 0.1 from the scale variable, i define the style of the div using ngStyle
with [ngStyle]="{ transform: 'scale(' + scale + ')' }"
and added a cdkDrag
to support dragging this div around the screen.
since drag and drop uses transform and scaling using transform whenever I try to scale up or down and a few times and then move it around, then scale it again a few times and move it around.. it have a weird behavior of going back to the original position and going back to the original size while moving it around.
i saw some old bug reports from a few years ago but i couldn't find anything that could help in my situation.
so my template file is this:
<div cdkDrag [ngStyle]="{ transform: 'scale(' + scale + ')' }">
<button mat-icon-button (click)="zoomIn()" color="primary">
<mat-icon>zoom_in</mat-icon>
</button>
<button mat-icon-button (click)="zoomOut()" color="primary">
<mat-icon>zoom_out</mat-icon>
</button>
<p>Start editing to see some magic happen :)</p>
</div>
and I also reproduced at Stackblitz link
any information regarding this issue would be greatly appreciated.