File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ export class Editor extends toolboxeditor.ToolboxEditor {
6161 showCategories : boolean = true ;
6262 breakpointsByBlock : pxt . Map < number > ; // Map block id --> breakpoint ID
6363 breakpointsSet : number [ ] ; // the IDs of the breakpoints set.
64+ currentFlyoutKey : string ;
6465
6566 private errorChangesListeners : pxt . Map < ( errors : pxtblockly . BlockDiagnostic [ ] ) => void > = { } ;
6667 protected intersectionObserver : IntersectionObserver ;
@@ -667,6 +668,13 @@ export class Editor extends toolboxeditor.ToolboxEditor {
667668 this . hideFlyout ( ) ;
668669 }
669670
671+ if ( ev . type === "var_create" ) {
672+ if ( this . currentFlyoutKey === "variables" && this . editor . getFlyout ( ) ?. isVisible ( ) ) {
673+ // refresh the flyout when a new variable is created
674+ this . showVariablesFlyout ( ) ;
675+ }
676+ }
677+
670678 if ( ( ignoredChanges . indexOf ( ev . type ) === - 1 )
671679 || this . markIncomplete ) {
672680 this . changeCallback ( ) ;
@@ -1696,6 +1704,7 @@ export class Editor extends toolboxeditor.ToolboxEditor {
16961704 }
16971705
16981706 private showFlyoutInternal_ ( xmlList : Element [ ] , flyoutName : string = "default" ) {
1707+ this . currentFlyoutKey = flyoutName ;
16991708 const flyout = this . editor . getFlyout ( ) as pxtblockly . VerticalFlyout ;
17001709 flyout . show ( xmlList , flyoutName ) ;
17011710 flyout . scrollToStart ( ) ;
You can’t perform that action at this time.
0 commit comments