File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ const clickInterval = 250
44
44
45
45
class Selection {
46
46
constructor ( node , { global = false , longPressThreshold = 250 } = { } ) {
47
+ this . isDetached = false
47
48
this . container = node
48
49
this . globalMouse = ! node || global
49
50
this . longPressThreshold = longPressThreshold
@@ -95,6 +96,7 @@ class Selection {
95
96
}
96
97
97
98
teardown ( ) {
99
+ this . isDetached = true
98
100
this . listeners = Object . create ( null )
99
101
this . _onTouchMoveWindowListener && this . _onTouchMoveWindowListener . remove ( )
100
102
this . _onInitialEventListener && this . _onInitialEventListener . remove ( )
@@ -206,6 +208,10 @@ class Selection {
206
208
}
207
209
208
210
_handleInitialEvent ( e ) {
211
+ if ( this . isDetached ) {
212
+ return
213
+ }
214
+
209
215
const { clientX, clientY, pageX, pageY } = getEventCoordinates ( e )
210
216
let node = this . container ( ) ,
211
217
collides ,
@@ -344,7 +350,7 @@ class Selection {
344
350
}
345
351
346
352
_handleMoveEvent ( e ) {
347
- if ( this . _initialEventData === null ) {
353
+ if ( this . _initialEventData === null || this . isDetached ) {
348
354
return
349
355
}
350
356
You can’t perform that action at this time.
0 commit comments