@@ -20,7 +20,7 @@ export default class ScrollingMonitor {
2020 this . container . addEventListener ( 'dragover' , this . handleEvent ) ;
2121 // touchmove events don't seem to work across siblings, so we unfortunately
2222 // have to attach the listeners to the body
23- window . document . body . addEventListener ( 'touchmove' , this . handleEvent ) ;
23+ this . container . ownerDocument . body . addEventListener ( 'touchmove' , this . handleEvent ) ;
2424
2525 this . clearMonitorSubscription = this . dragDropManager
2626 . getMonitor ( )
@@ -29,7 +29,7 @@ export default class ScrollingMonitor {
2929
3030 stop ( ) {
3131 this . container . removeEventListener ( 'dragover' , this . handleEvent ) ;
32- window . document . body . removeEventListener ( 'touchmove' , this . handleEvent ) ;
32+ this . container . ownerDocument . body . removeEventListener ( 'touchmove' , this . handleEvent ) ;
3333 this . clearMonitorSubscription ( ) ;
3434 this . stopScrolling ( ) ;
3535 }
@@ -54,14 +54,14 @@ export default class ScrollingMonitor {
5454
5555 attach ( ) {
5656 this . attached = true ;
57- window . document . body . addEventListener ( 'dragover' , this . updateScrolling ) ;
58- window . document . body . addEventListener ( 'touchmove' , this . updateScrolling ) ;
57+ this . container . ownerDocument . body . addEventListener ( 'dragover' , this . updateScrolling ) ;
58+ this . container . ownerDocument . body . addEventListener ( 'touchmove' , this . updateScrolling ) ;
5959 }
6060
6161 detach ( ) {
6262 this . attached = false ;
63- window . document . body . removeEventListener ( 'dragover' , this . updateScrolling ) ;
64- window . document . body . removeEventListener ( 'touchmove' , this . updateScrolling ) ;
63+ this . container . ownerDocument . body . removeEventListener ( 'dragover' , this . updateScrolling ) ;
64+ this . container . ownerDocument . body . removeEventListener ( 'touchmove' , this . updateScrolling ) ;
6565 }
6666
6767 // Update scaleX and scaleY every 100ms or so
0 commit comments