Skip to content

Commit b1cf996

Browse files
committed
fix(IgxDrag/IgxDrop): IE11 and Edge fix #5639
1 parent 7353e57 commit b1cf996

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

projects/igniteui-angular/src/lib/directives/drag-drop/drag-drop.directive.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,8 @@ export class IgxDragDirective implements AfterContentInit, OnDestroy {
942942

943943
const totalMovedX = pageX - this._startX;
944944
const totalMovedY = pageY - this._startY;
945-
this._dragGhostHostX = this.dragGhostHost ? this.getdragGhostHostOffsetLeft(this.dragGhostHost) : 0;
946-
this._dragGhostHostY = this.dragGhostHost ? this.getdragGhostHostOffsetTop(this.dragGhostHost) : 0;
945+
this._dragGhostHostX = this.dragGhostHost ? this.getDragGhostHostOffsetLeft(this.dragGhostHost) : 0;
946+
this._dragGhostHostY = this.dragGhostHost ? this.getDragGhostHostOffsetTop(this.dragGhostHost) : 0;
947947

948948
this.dragGhost.style.transitionDuration = '0.0s';
949949
this.dragGhost.style.position = 'absolute';
@@ -1219,21 +1219,21 @@ export class IgxDragDirective implements AfterContentInit, OnDestroy {
12191219
return window.scrollX ? window.scrollX : (window.pageXOffset ? window.pageXOffset : 0);
12201220
}
12211221

1222-
protected getdragGhostHostOffsetLeft(dragGhostHost: any) {
1223-
if (dragGhostHost.computedStyleMap().get('position').value === 'static' &&
1224-
dragGhostHost.offsetParent && dragGhostHost.offsetParent === document.body) {
1222+
protected getDragGhostHostOffsetLeft(dragGhostHost: any) {
1223+
const ghostPosition = document.defaultView.getComputedStyle(dragGhostHost).getPropertyValue('position');
1224+
if (ghostPosition === 'static' && dragGhostHost.offsetParent && dragGhostHost.offsetParent === document.body) {
12251225
return 0;
1226-
} else if (dragGhostHost.computedStyleMap().get('position').value === 'static' && dragGhostHost.offsetParent) {
1226+
} else if (ghostPosition === 'static' && dragGhostHost.offsetParent) {
12271227
return dragGhostHost.offsetParent.getBoundingClientRect().left;
12281228
}
12291229
return dragGhostHost.getBoundingClientRect().left;
12301230
}
12311231

1232-
protected getdragGhostHostOffsetTop(dragGhostHost: any) {
1233-
if (dragGhostHost.computedStyleMap().get('position').value === 'static' &&
1234-
dragGhostHost.offsetParent && dragGhostHost.offsetParent === document.body) {
1232+
protected getDragGhostHostOffsetTop(dragGhostHost: any) {
1233+
const ghostPosition = document.defaultView.getComputedStyle(dragGhostHost).getPropertyValue('position');
1234+
if (ghostPosition === 'static' && dragGhostHost.offsetParent && dragGhostHost.offsetParent === document.body) {
12351235
return 0;
1236-
} else if (dragGhostHost.computedStyleMap().get('position').value === 'static' && dragGhostHost.offsetParent) {
1236+
} else if (ghostPosition === 'static' && dragGhostHost.offsetParent) {
12371237
return dragGhostHost.offsetParent.getBoundingClientRect().top;
12381238
}
12391239
return dragGhostHost.getBoundingClientRect().top;

0 commit comments

Comments
 (0)