File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,6 @@ export class EnterAction {
146146
147147 workspace . setResizesEnabled ( true ) ;
148148
149- getFocusManager ( ) . focusTree ( workspace ) ;
150- workspace . getCursor ( ) ?. setCurNode ( newBlock ) ;
151149 this . mover . startMove ( workspace , newBlock , insertStartPoint ) ;
152150
153151 const isStartBlock =
Original file line number Diff line number Diff line change @@ -143,8 +143,9 @@ export class Mover {
143143 dragger . onDragStart ( info . fakePointerEvent ( 'pointerdown' ) ) ;
144144 info . updateTotalDelta ( ) ;
145145 // In case the block is detached, ensure that it still retains focus
146- // (otherwise dragging will break).
147- getFocusManager ( ) . focusNode ( block ) ;
146+ // (otherwise dragging will break). This is also the point a new block's
147+ // initial insert position is scrolled into view.
148+ workspace . getCursor ( ) ?. setCurNode ( block ) ;
148149 block . getFocusableElement ( ) . addEventListener ( 'blur' , blurListener ) ;
149150
150151 // Register a keyboard shortcut under the key combos of all existing
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ suite('Scrolling into view', function () {
5353 await this . browser . keys ( Key . Enter ) ;
5454
5555 // Asset new block has been scrolled into the viewport.
56+ await this . browser . pause ( PAUSE_TIME ) ;
5657 const inViewport = await this . browser . execute ( ( ) => {
5758 const workspace = Blockly . getMainWorkspace ( ) as Blockly . WorkspaceSvg ;
5859 const block = workspace . getBlocksByType (
@@ -68,7 +69,6 @@ suite('Scrolling into view', function () {
6869 ) ;
6970 return viewport . contains ( blockBounds . left , blockBounds . top ) ;
7071 } ) ;
71- // FIXME: actually scrolls the wrong bounds into view
72- chai . assert . isFalse ( inViewport ) ;
72+ chai . assert . isTrue ( inViewport ) ;
7373 } ) ;
7474} ) ;
You can’t perform that action at this time.
0 commit comments