Procházet zdrojové kódy

fix drag bug. unbind from window with capturing

Adam Shaw před 7 roky
rodič
revize
18ea62bbf5
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      src/dnd/PointerDragging.ts

+ 2 - 2
src/dnd/PointerDragging.ts

@@ -192,7 +192,7 @@ export default class PointerDragging {
       target.removeEventListener('touchmove', this.handleTouchMove)
       target.removeEventListener('touchend', this.handleTouchEnd)
       target.removeEventListener('touchcancel', this.handleTouchEnd)
-      window.removeEventListener('scroll', this.handleTouchScroll)
+      window.removeEventListener('scroll', this.handleTouchScroll, true) // wasCaptured=true
 
       this.emitter.trigger('pointerup', createEventFromTouch(ev, this.subjectEl!))
 
@@ -247,7 +247,7 @@ export default class PointerDragging {
 
   destroyScrollWatch() {
     if (this.shouldWatchScroll) {
-      window.removeEventListener('scroll', this.handleScroll)
+      window.removeEventListener('scroll', this.handleScroll, true) // wasCaptured=true
     }
   }