@@ -942,8 +942,8 @@ export class IgxDragDirective implements AfterContentInit, OnDestroy {
942
942
943
943
const totalMovedX = pageX - this . _startX ;
944
944
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 ;
947
947
948
948
this . dragGhost . style . transitionDuration = '0.0s' ;
949
949
this . dragGhost . style . position = 'absolute' ;
@@ -1220,21 +1220,21 @@ export class IgxDragDirective implements AfterContentInit, OnDestroy {
1220
1220
return window . scrollX ? window . scrollX : ( window . pageXOffset ? window . pageXOffset : 0 ) ;
1221
1221
}
1222
1222
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 ) {
1226
1226
return 0 ;
1227
- } else if ( dragGhostHost . computedStyleMap ( ) . get ( 'position' ) . value === 'static' && dragGhostHost . offsetParent ) {
1227
+ } else if ( ghostPosition === 'static' && dragGhostHost . offsetParent ) {
1228
1228
return dragGhostHost . offsetParent . getBoundingClientRect ( ) . left ;
1229
1229
}
1230
1230
return dragGhostHost . getBoundingClientRect ( ) . left ;
1231
1231
}
1232
1232
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 ) {
1236
1236
return 0 ;
1237
- } else if ( dragGhostHost . computedStyleMap ( ) . get ( 'position' ) . value === 'static' && dragGhostHost . offsetParent ) {
1237
+ } else if ( ghostPosition === 'static' && dragGhostHost . offsetParent ) {
1238
1238
return dragGhostHost . offsetParent . getBoundingClientRect ( ) . top ;
1239
1239
}
1240
1240
return dragGhostHost . getBoundingClientRect ( ) . top ;
0 commit comments