Explorar o código

fix drag bug. unbind from window with capturing

Adam Shaw %!s(int64=7) %!d(string=hai) anos
pai
achega
18ea62bbf5
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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('touchmove', this.handleTouchMove)
       target.removeEventListener('touchend', this.handleTouchEnd)
       target.removeEventListener('touchend', this.handleTouchEnd)
       target.removeEventListener('touchcancel', 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!))
       this.emitter.trigger('pointerup', createEventFromTouch(ev, this.subjectEl!))
 
 
@@ -247,7 +247,7 @@ export default class PointerDragging {
 
 
   destroyScrollWatch() {
   destroyScrollWatch() {
     if (this.shouldWatchScroll) {
     if (this.shouldWatchScroll) {
-      window.removeEventListener('scroll', this.handleScroll)
+      window.removeEventListener('scroll', this.handleScroll, true) // wasCaptured=true
     }
     }
   }
   }