@@ -31,6 +31,11 @@ import {clearMoveHints} from '../hints';
3131 */
3232const UNCONSTRAINED_MOVE_DISTANCE = 20 ;
3333
34+ /**
35+ * The amount of additional padding to include during a constrained move.
36+ */
37+ const CONSTRAINED_ADDITIONAL_PADDING = 70 ;
38+
3439/**
3540 * Low-level code for moving blocks with keyboard shortcuts.
3641 */
@@ -226,7 +231,7 @@ export class Mover {
226231 ) ;
227232
228233 info . updateTotalDelta ( ) ;
229- this . scrollCurrentBlockIntoView ( workspace ) ;
234+ this . scrollCurrentBlockIntoView ( workspace , CONSTRAINED_ADDITIONAL_PADDING ) ;
230235 return true ;
231236 }
232237
@@ -326,13 +331,15 @@ export class Mover {
326331 * @param padding Amount of spacing to put between the bounds and the edge of
327332 * the workspace's viewport.
328333 */
329- private scrollCurrentBlockIntoView ( workspace : WorkspaceSvg , padding = 10 ) {
334+ private scrollCurrentBlockIntoView ( workspace : WorkspaceSvg , padding = 0 ) {
330335 const blockToView = this . moves . get ( workspace ) ?. block ;
331336 if ( blockToView ) {
332- workspace . scrollBoundsIntoView (
333- blockToView . getBoundingRectangleWithoutChildren ( ) ,
334- padding ,
335- ) ;
337+ const bounds = blockToView . getBoundingRectangleWithoutChildren ( ) . clone ( ) ;
338+ bounds . top -= padding ;
339+ bounds . bottom += padding ;
340+ bounds . left -= padding ;
341+ bounds . right += padding ;
342+ workspace . scrollBoundsIntoView ( bounds ) ;
336343 }
337344 }
338345
0 commit comments