File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,11 @@ export class ActionMenu {
8686 const node = cursor . getCurNode ( ) ;
8787 if ( ! node ) return false ;
8888 // TODO(google/blockly#8847): Add typeguard for IContextMenu in core when this moves over
89- const location = node . getLocation ( ) as any ;
90- if ( location . showContextMenu ) {
89+ const location = node . getLocation ( ) ;
90+ if (
91+ 'showContextMenu' in location &&
92+ typeof location . showContextMenu === 'function'
93+ ) {
9194 location . showContextMenu ( menuOpenEvent ) ;
9295 } else {
9396 console . info ( `No action menu for ASTNode of type ${ node . getType ( ) } ` ) ;
Original file line number Diff line number Diff line change 88 ASTNode ,
99 BlockSvg ,
1010 ConnectionType ,
11- LineCursor ,
1211 RenderedConnection ,
1312 dragging ,
1413 utils ,
You can’t perform that action at this time.
0 commit comments