File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -453,9 +453,14 @@ export abstract class ViewBase<
453453 return this . root ;
454454 }
455455
456+ private _skipNextVisibilityChange : boolean = false ;
457+
456458 getChildren ( node ?: ViewNode ) : ViewNode [ ] | Promise < ViewNode [ ] > {
457459 if ( node != null ) return node . getChildren ( ) ;
458460
461+ // If we are already visible, then skip the next visibility change event otherwise we end up refreshing twice
462+ this . _skipNextVisibilityChange = this . tree ?. visible ?? false ;
463+
459464 const root = this . ensureRoot ( ) ;
460465 const children = root . getChildren ( ) ;
461466 if ( ! this . initialized ) {
@@ -527,7 +532,13 @@ export abstract class ViewBase<
527532 void this . container . usage . track ( `${ this . trackingFeature } :shown` ) . catch ( ) ;
528533 }
529534
530- this . _onDidChangeVisibility . fire ( e ) ;
535+ const skip = this . _skipNextVisibilityChange ;
536+ this . _skipNextVisibilityChange = false ;
537+
538+ if ( ! skip || ! e . visible ) {
539+ this . _onDidChangeVisibility . fire ( e ) ;
540+ }
541+
531542 if ( e . visible ) {
532543 this . notifySelections ( ) ;
533544 }
You can’t perform that action at this time.
0 commit comments