@@ -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' ;
@@ -1219,21 +1219,21 @@ export class IgxDragDirective implements AfterContentInit, OnDestroy {
1219
1219
return window . scrollX ? window . scrollX : ( window . pageXOffset ? window . pageXOffset : 0 ) ;
1220
1220
}
1221
1221
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 ) {
1225
1225
return 0 ;
1226
- } else if ( dragGhostHost . computedStyleMap ( ) . get ( 'position' ) . value === 'static' && dragGhostHost . offsetParent ) {
1226
+ } else if ( ghostPosition === 'static' && dragGhostHost . offsetParent ) {
1227
1227
return dragGhostHost . offsetParent . getBoundingClientRect ( ) . left ;
1228
1228
}
1229
1229
return dragGhostHost . getBoundingClientRect ( ) . left ;
1230
1230
}
1231
1231
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 ) {
1235
1235
return 0 ;
1236
- } else if ( dragGhostHost . computedStyleMap ( ) . get ( 'position' ) . value === 'static' && dragGhostHost . offsetParent ) {
1236
+ } else if ( ghostPosition === 'static' && dragGhostHost . offsetParent ) {
1237
1237
return dragGhostHost . offsetParent . getBoundingClientRect ( ) . top ;
1238
1238
}
1239
1239
return dragGhostHost . getBoundingClientRect ( ) . top ;
0 commit comments