Skip to content

Commit

Permalink
fix: disable dragging effects on resizable elements on webkit browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Jun 25, 2016
1 parent 60c2e08 commit 59078e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/resizable.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ export class Resizable implements OnInit {
top: string,
width: string,
height: string,
'user-drag': string
'user-drag': string,
'-webkit-user-drag': string
}
};

Expand Down Expand Up @@ -207,13 +208,15 @@ export class Resizable implements OnInit {
top: this.elm.nativeElement.style.top,
width: `${startingRect.width}px`,
height: `${startingRect.height}px`,
'user-drag': this.elm.nativeElement.style['user-drag']
'user-drag': this.elm.nativeElement.style['user-drag'],
'-webkit-user-drag': this.elm.nativeElement.style['-webkit-user-drag']
}
};
this.renderer.setElementStyle(this.elm.nativeElement, 'position', 'fixed');
this.renderer.setElementStyle(this.elm.nativeElement, 'left', `${currentResize.startingRect.left}px`);
this.renderer.setElementStyle(this.elm.nativeElement, 'top', `${currentResize.startingRect.top}px`);
this.renderer.setElementStyle(this.elm.nativeElement, 'user-drag', 'none');
this.renderer.setElementStyle(this.elm.nativeElement, '-webkit-user-drag', 'none');
this.onResizeStart.emit({
edges,
rectangle: getNewBoundingRectangle(startingRect, {}, 0, 0)
Expand Down

0 comments on commit 59078e2

Please sign in to comment.