This repository was archived by the owner on Jun 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export default class HTML5Backend {
31
31
this . handleTopDropCapture = this . handleTopDropCapture . bind ( this ) ;
32
32
this . handleSelectStart = this . handleSelectStart . bind ( this ) ;
33
33
this . endDragIfSourceWasRemovedFromDOM = this . endDragIfSourceWasRemovedFromDOM . bind ( this ) ;
34
+ this . endDragNativeItem = this . endDragNativeItem . bind ( this ) ;
34
35
}
35
36
36
37
setup ( ) {
@@ -170,9 +171,18 @@ export default class HTML5Backend {
170
171
this . currentNativeSource = new SourceType ( ) ;
171
172
this . currentNativeHandle = this . registry . addSource ( type , this . currentNativeSource ) ;
172
173
this . actions . beginDrag ( [ this . currentNativeHandle ] ) ;
174
+
175
+ // If mousemove fires, the drag is over but browser failed to tell us.
176
+ window . addEventListener ( 'mousemove' , this . endDragNativeItem , true ) ;
173
177
}
174
178
175
179
endDragNativeItem ( ) {
180
+ if ( ! this . isDraggingNativeItem ( ) ) {
181
+ return ;
182
+ }
183
+
184
+ window . removeEventListener ( 'mousemove' , this . endDragNativeItem , true ) ;
185
+
176
186
this . actions . endDrag ( ) ;
177
187
this . registry . removeSource ( this . currentNativeHandle ) ;
178
188
this . currentNativeHandle = null ;
You can’t perform that action at this time.
0 commit comments