@@ -1580,7 +1580,8 @@ export default class DataBrowser extends React.Component {
15801580 this . autoScrollResumeTimeoutId = setTimeout ( ( ) => {
15811581 if ( this . state . isAutoScrolling && this . state . autoScrollPaused ) {
15821582 // Clear so the 2-second post-block delay doesn't stack on top
1583- this . autoScrollWasBlocked = false ;
1583+ this . autoScrollLastUnblockedAt = 0 ;
1584+ this . autoScrollIsBlocked = false ;
15841585 this . setState ( { autoScrollPaused : false } ) ;
15851586 }
15861587 } , 1000 ) ;
@@ -1703,6 +1704,9 @@ export default class DataBrowser extends React.Component {
17031704 handleMouseButtonUp ( e ) {
17041705 if ( e . button === 0 ) {
17051706 this . mouseButtonPressed = false ;
1707+ if ( this . state . isAutoScrolling ) {
1708+ this . autoScrollLastUnblockedAt = Date . now ( ) ;
1709+ }
17061710 }
17071711 }
17081712
@@ -1711,7 +1715,8 @@ export default class DataBrowser extends React.Component {
17111715 return ;
17121716 }
17131717
1714- this . autoScrollWasBlocked = false ;
1718+ this . autoScrollLastUnblockedAt = 0 ;
1719+ this . autoScrollIsBlocked = false ;
17151720 this . setState ( { isAutoScrolling : true , autoScrollPaused : false } , ( ) => {
17161721 this . performAutoScrollStep ( ) ;
17171722 } ) ;
@@ -1730,7 +1735,8 @@ export default class DataBrowser extends React.Component {
17301735 cancelAnimationFrame ( this . autoScrollAnimationId ) ;
17311736 this . autoScrollAnimationId = null ;
17321737 }
1733- this . autoScrollWasBlocked = false ;
1738+ this . autoScrollLastUnblockedAt = 0 ;
1739+ this . autoScrollIsBlocked = false ;
17341740 this . setState ( {
17351741 isAutoScrolling : false ,
17361742 autoScrollPaused : false ,
@@ -1748,20 +1754,27 @@ export default class DataBrowser extends React.Component {
17481754 }
17491755
17501756 if ( this . isAutoScrollBlocked ( ) ) {
1751- this . autoScrollWasBlocked = true ;
1757+ this . autoScrollIsBlocked = true ;
17521758 this . autoScrollTimeoutId = setTimeout ( ( ) => {
17531759 this . performAutoScrollStep ( ) ;
17541760 } , 100 ) ;
17551761 return ;
17561762 }
17571763
1758- // After unblocking, wait 2 seconds before resuming
1759- if ( this . autoScrollWasBlocked ) {
1760- this . autoScrollWasBlocked = false ;
1761- this . autoScrollTimeoutId = setTimeout ( ( ) => {
1762- this . performAutoScrollStep ( ) ;
1763- } , 2000 ) ;
1764- return ;
1764+ // Record when block cleared; wait 2 seconds from the most recent unblock
1765+ if ( this . autoScrollIsBlocked ) {
1766+ this . autoScrollIsBlocked = false ;
1767+ this . autoScrollLastUnblockedAt = Date . now ( ) ;
1768+ }
1769+ if ( this . autoScrollLastUnblockedAt ) {
1770+ const elapsed = Date . now ( ) - this . autoScrollLastUnblockedAt ;
1771+ if ( elapsed < 2000 ) {
1772+ this . autoScrollTimeoutId = setTimeout ( ( ) => {
1773+ this . performAutoScrollStep ( ) ;
1774+ } , 2000 - elapsed ) ;
1775+ return ;
1776+ }
1777+ this . autoScrollLastUnblockedAt = 0 ;
17651778 }
17661779
17671780 // Get the scrollable container
@@ -1794,7 +1807,7 @@ export default class DataBrowser extends React.Component {
17941807
17951808 const animateScroll = ( currentTime ) => {
17961809 if ( ! this . state . isAutoScrolling || this . isAutoScrollBlocked ( ) ) {
1797- this . autoScrollWasBlocked = true ;
1810+ this . autoScrollIsBlocked = true ;
17981811 // If stopped or blocked during animation, schedule next check
17991812 this . autoScrollTimeoutId = setTimeout ( ( ) => {
18001813 this . performAutoScrollStep ( ) ;
0 commit comments