Skip to content

Commit

Permalink
Revert "FEATURE: Increased number of visible rows in combo box to 8 (#…
Browse files Browse the repository at this point in the history
…2128)"

This reverts commit 26147ef.
  • Loading branch information
JindrichSusen committed Nov 7, 2023
1 parent a8d3b49 commit c1c1116
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export function DropdownEditorBody() {
rectCtrl={rectCtrl}
beh={beh}
rowHeight={rowHeight}
height={8 * rowHeight}
/>
</div>
)}
Expand All @@ -78,7 +77,7 @@ export class DropdownEditorTable extends React.Component<{
rectCtrl: BoundingRect,
beh: IDropdownEditorBehavior,
rowHeight: number,
height: number
height?: number
}> {
refMultiGrid = createRef<MultiGrid>();
@observable
Expand All @@ -87,6 +86,7 @@ export class DropdownEditorTable extends React.Component<{
hoveredRowIndex= - 1;
columnCount = 0;
readonly cellPadding = 20;
readonly maxHeight = 150;
disposer: any;

componentDidMount() {
Expand All @@ -97,6 +97,17 @@ export class DropdownEditorTable extends React.Component<{
return this.props.dataTable.rowCount + (this.hasHeader ? 1 : 0);
}

get height(){
if(this.props.height){
return this.props.height;
}
let height = 0;
for (let i = 0; i < this.rowCount; i++) {
height = height + this.props.rowHeight;
}
return Math.min(height, this.maxHeight) + this.scrollbarSize.horiz;
}

constructor(props: any) {
super(props);
this.columnCount = this.props.drivers.driverCount;
Expand Down Expand Up @@ -177,7 +188,7 @@ export class DropdownEditorTable extends React.Component<{
columnWidth={({ index }) => widths[index]}
rowHeight={this.props.rowHeight}
fixedRowCount={this.hasHeader ? 1 : 0}
height={this.props.height}
height={this.height}
width={windowWidth}
cellRenderer={args => this.renderTableCell(args)}
onScroll={this.props.beh.handleScroll}
Expand Down

0 comments on commit c1c1116

Please sign in to comment.