Skip to content

Commit

Permalink
fix: Add startingRect scroll position to cloned node. (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Wesoff authored and mattlewis92 committed Sep 28, 2017
1 parent b8ab1c7 commit a056154
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/interfaces/boundingRectangle.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export interface BoundingRectangle {
right: number;
height?: number;
width?: number;
scrollTop?: number;
scrollLeft?: number;
}
6 changes: 5 additions & 1 deletion src/resizable.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ function getElementRect(element: ElementRef, ghostElementPositioning: string): B
top: boundingRect.top,
bottom: boundingRect.bottom,
left: boundingRect.left,
right: boundingRect.right
right: boundingRect.right,
scrollTop: element.nativeElement.scrollTop,
scrollLeft: element.nativeElement.scrollLeft
};
}
}
Expand Down Expand Up @@ -493,6 +495,8 @@ export class Resizable implements OnInit, OnDestroy, AfterViewInit {
this.renderer.setStyle(currentResize.clonedNode, 'width', `${currentResize.startingRect.width}px`);
this.renderer.setStyle(currentResize.clonedNode, 'cursor', getResizeCursor(currentResize.edges, resizeCursors));
this.renderer.addClass(currentResize.clonedNode, RESIZE_GHOST_ELEMENT_CLASS);
currentResize.clonedNode.scrollTop = currentResize.startingRect.scrollTop;
currentResize.clonedNode.scrollLeft = currentResize.startingRect.scrollLeft;
}
this.zone.run(() => {
this.resizeStart.emit({
Expand Down

0 comments on commit a056154

Please sign in to comment.