File tree 1 file changed +5
-2
lines changed
arduino-ide-extension/src/browser/widgets/component-list
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export class ComponentList<T extends ArduinoComponent> extends React.Component<
63
63
prevState : ComponentList . State
64
64
) : void {
65
65
if ( this . resizeAllFlag || this . props . items !== prevProps . items ) {
66
- this . clearAll ( ) ;
66
+ this . clearAll ( true ) ;
67
67
} else if ( this . state . focusIndex !== prevState . focusIndex ) {
68
68
if ( typeof this . state . focusIndex === 'number' ) {
69
69
this . clear ( this . state . focusIndex ) ;
@@ -78,11 +78,14 @@ export class ComponentList<T extends ArduinoComponent> extends React.Component<
78
78
this . list = ref || undefined ;
79
79
} ;
80
80
81
- private clearAll ( ) : void {
81
+ private clearAll ( scrollToTop = false ) : void {
82
82
this . resizeAllFlag = false ;
83
83
this . cache . clearAll ( ) ;
84
84
if ( this . list ) {
85
85
this . list . recomputeRowHeights ( ) ;
86
+ if ( scrollToTop ) {
87
+ this . list . scrollToPosition ( 0 ) ;
88
+ }
86
89
}
87
90
}
88
91
You can’t perform that action at this time.
0 commit comments