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 {
3131 this . handleTopDropCapture = this . handleTopDropCapture . bind ( this ) ;
3232 this . handleSelectStart = this . handleSelectStart . bind ( this ) ;
3333 this . endDragIfSourceWasRemovedFromDOM = this . endDragIfSourceWasRemovedFromDOM . bind ( this ) ;
34+ this . endDragNativeItem = this . endDragNativeItem . bind ( this ) ;
3435 }
3536
3637 setup ( ) {
@@ -170,9 +171,18 @@ export default class HTML5Backend {
170171 this . currentNativeSource = new SourceType ( ) ;
171172 this . currentNativeHandle = this . registry . addSource ( type , this . currentNativeSource ) ;
172173 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 ) ;
173177 }
174178
175179 endDragNativeItem ( ) {
180+ if ( ! this . isDraggingNativeItem ( ) ) {
181+ return ;
182+ }
183+
184+ window . removeEventListener ( 'mousemove' , this . endDragNativeItem , true ) ;
185+
176186 this . actions . endDrag ( ) ;
177187 this . registry . removeSource ( this . currentNativeHandle ) ;
178188 this . currentNativeHandle = null ;
You can’t perform that action at this time.
0 commit comments