File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 55 */
66
77import * as browserEvents from '../browser_events.js' ;
8+ import { getFocusManager } from '../focus_manager.js' ;
89import * as touch from '../touch.js' ;
910import * as dom from '../utils/dom.js' ;
1011import { Svg } from '../utils/svg.js' ;
@@ -98,5 +99,6 @@ export class DeleteCommentBarButton extends CommentBarButton {
9899
99100 this . getParentComment ( ) . dispose ( ) ;
100101 e ?. stopPropagation ( ) ;
102+ getFocusManager ( ) . focusNode ( this . workspace ) ;
101103 }
102104}
Original file line number Diff line number Diff line change 44 * SPDX-License-Identifier: Apache-2.0
55 */
66
7+ import { assert } from '../../node_modules/chai/chai.js' ;
78import {
89 assertEventFired ,
910 createChangeListenerSpy ,
@@ -167,5 +168,15 @@ suite('Workspace comment', function () {
167168 this . workspace . id ,
168169 ) ;
169170 } ) ;
171+
172+ test ( 'focuses the workspace when deleted' , function ( ) {
173+ const comment = new Blockly . comments . RenderedWorkspaceComment (
174+ this . workspace ,
175+ ) ;
176+ Blockly . getFocusManager ( ) . focusNode ( comment ) ;
177+ assert . equal ( Blockly . getFocusManager ( ) . getFocusedNode ( ) , comment ) ;
178+ comment . view . getCommentBarButtons ( ) [ 1 ] . performAction ( ) ;
179+ assert . equal ( Blockly . getFocusManager ( ) . getFocusedNode ( ) , this . workspace ) ;
180+ } ) ;
170181 } ) ;
171182} ) ;
You can’t perform that action at this time.
0 commit comments