@@ -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