Fix for double clicking column handle in results table where the column width would not update correctly when the longest row item is the top item in the viewPort (#1504)

This commit is contained in:
Lance Klinger
2018-05-31 15:03:33 -04:00
committed by Anthony Dresser
parent 0414ab6e6a
commit f2df9f3917

View File

@@ -67,7 +67,7 @@ export class AutoColumnSize<T> implements Slick.Plugin<T> {
let rowEl = this.createRow(columnDef); let rowEl = this.createRow(columnDef);
let data = this._grid.getData(); let data = this._grid.getData();
let viewPort = this._grid.getViewport(); let viewPort = this._grid.getViewport();
let start = Math.max(0, viewPort.top + 1); let start = Math.max(0, viewPort.top);
let end = Math.min(data.getLength(), viewPort.bottom); let end = Math.min(data.getLength(), viewPort.bottom);
for (let i = start; i < end; i++) { for (let i = start; i < end; i++) {
texts.push(data.getItem(i)[columnDef.field]); texts.push(data.getItem(i)[columnDef.field]);