Skip to content

Commit e98cd1a

Browse files
authored
Merge pull request #5650 from IgniteUI/mpavlov/issue-5639
fix(IgxDrag/IgxDrop): IE11 and Edge fix #5639
2 parents 4394b0f + 453bb1c commit e98cd1a

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';
@@ -1220,21 +1220,21 @@ export class IgxDragDirective implements AfterContentInit, OnDestroy {
12201220
return window.scrollX ? window.scrollX : (window.pageXOffset ? window.pageXOffset : 0);
12211221
}
12221222

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

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

0 commit comments

Comments
 (0)