File tree 1 file changed +8
-4
lines changed
arduino-ide-extension/src/browser/widgets/component-list
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change
1
+ import 'react-virtualized/styles.css' ;
1
2
import * as React from '@theia/core/shared/react' ;
2
3
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer' ;
3
4
import {
@@ -101,10 +102,13 @@ export class ComponentList<T extends ArduinoComponent> extends React.Component<
101
102
private clear ( index : number ) : void {
102
103
this . cache . clear ( index , 0 ) ;
103
104
this . list ?. recomputeRowHeights ( index ) ;
104
- // Update the last item if the if the one before was updated
105
- if ( index === this . props . items . length - 2 ) {
106
- this . cache . clear ( index + 1 , 0 ) ;
107
- this . list ?. recomputeRowHeights ( index + 1 ) ;
105
+ // The last two items are special as the required height of the
106
+ // container might change when hovering over those two last items.
107
+ if (
108
+ index === this . props . items . length - 1 ||
109
+ index === this . props . items . length - 2
110
+ ) {
111
+ this . list ?. recomputeGridSize ( ) ;
108
112
}
109
113
}
110
114
You can’t perform that action at this time.
0 commit comments