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
4444
4545class Selection {
4646 constructor ( node , { global = false , longPressThreshold = 250 } = { } ) {
47+ this . isDetached = false
4748 this . container = node
4849 this . globalMouse = ! node || global
4950 this . longPressThreshold = longPressThreshold
@@ -95,6 +96,7 @@ class Selection {
9596 }
9697
9798 teardown ( ) {
99+ this . isDetached = true
98100 this . listeners = Object . create ( null )
99101 this . _onTouchMoveWindowListener && this . _onTouchMoveWindowListener . remove ( )
100102 this . _onInitialEventListener && this . _onInitialEventListener . remove ( )
@@ -206,6 +208,10 @@ class Selection {
206208 }
207209
208210 _handleInitialEvent ( e ) {
211+ if ( this . isDetached ) {
212+ return
213+ }
214+
209215 const { clientX, clientY, pageX, pageY } = getEventCoordinates ( e )
210216 let node = this . container ( ) ,
211217 collides ,
@@ -344,7 +350,7 @@ class Selection {
344350 }
345351
346352 _handleMoveEvent ( e ) {
347- if ( this . _initialEventData === null ) {
353+ if ( this . _initialEventData === null || this . isDetached ) {
348354 return
349355 }
350356
You can’t perform that action at this time.
0 commit comments