@@ -82,7 +82,7 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
8282
8383 /** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
8484 protected _mouseEnter ( e : MouseEvent ) : void {
85- // console.log(`${count++} Enter ${this.el.id || (this.el as GridHTMLElement).gridstack.opts.id }`); // TEST
85+ // console.log(`${count++} Enter ${this.el.id}`); // TEST
8686 if ( ! DDManager . dragElement ) return ;
8787 // During touch drag operations, ignore real browser-generated mouseenter events (isTrusted:true) vs our simulated ones (isTrusted:false).
8888 // The browser can fire spurious mouseenter events when we dispatch simulated mousemove events.
@@ -91,6 +91,7 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
9191 if ( ! this . _canDrop ( DDManager . dragElement . el ) ) return ;
9292 e . preventDefault ( ) ;
9393 e . stopPropagation ( ) ;
94+ DDManager . dragElement . _stopScrolling ( ) ;
9495
9596 // make sure when we enter this, that the last one gets a leave FIRST to correctly cleanup as we don't always do
9697 if ( DDManager . dropElement && DDManager . dropElement !== this ) {
@@ -109,10 +110,12 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
109110
110111 /** @internal called when the item is leaving our area, stop tracking if we had moving item */
111112 protected _mouseLeave ( e : MouseEvent , calledByEnter = false ) : void {
112- // console.log(`${count++} Leave ${this.el.id || (this.el as GridHTMLElement).gridstack.opts.id }`); // TEST
113+ // console.log(`${count++} Leave ${this.el.id}`); // TEST
113114 if ( ! DDManager . dragElement || DDManager . dropElement !== this ) return ;
114115 e . preventDefault ( ) ;
115116 e . stopPropagation ( ) ;
117+ // stop the old grid's auto-scroll only when entering a new grid; if leaving to empty space keep scrolling until mouseup
118+ if ( calledByEnter ) DDManager . dragElement . _stopScrolling ( ) ;
116119
117120 const ev = Utils . initEvent < DragEvent > ( e , { target : this . el , type : 'dropout' } ) ;
118121 if ( this . option . out ) {
0 commit comments