Skip to content

Commit 1d0f641

Browse files
author
Akos Kitta
committed
Estimated row heights to provide better scroll UX.
Closes #1381 Signed-off-by: Akos Kitta <[email protected]>
1 parent cc43c8e commit 1d0f641

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: arduino-ide-extension/src/browser/widgets/component-list/component-list.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ComponentList<T extends ArduinoComponent> extends React.Component<
4343
constructor(props: ComponentList.Props<T>) {
4444
super(props);
4545
this.cache = new CellMeasurerCache({
46-
defaultHeight: 300,
46+
defaultHeight: 140,
4747
fixedWidth: true,
4848
});
4949
}
@@ -67,6 +67,11 @@ export class ComponentList<T extends ArduinoComponent> extends React.Component<
6767
rowHeight={this.cache.rowHeight}
6868
deferredMeasurementCache={this.cache}
6969
ref={this.setListRef}
70+
estimatedRowSize={140}
71+
// If default value, then `react-virtualized` will optimize and list item will not receive a `:hover` event.
72+
// Hence, install and version `<select>` won't be visible even if the mouse cursor is over the `<div>`.
73+
// See https://github.com/bvaughn/react-virtualized/blob/005be24a608add0344284053dae7633be86053b2/source/Grid/Grid.js#L38-L42
74+
scrollingResetTimeInterval={0}
7075
/>
7176
);
7277
}}

0 commit comments

Comments
 (0)