Grid.decreaseColumnWidth: fix scroll left bug

This commit is contained in:
Peter Fajdiga
2023-08-15 22:36:34 +02:00
parent 671326bdd7
commit e92563b424

View File

@@ -189,7 +189,8 @@ class Grid {
const shrinkLeft = leftInvisibleWidth < rightInvisibleWidth;
const widthDelta = (shrinkLeft ? leftInvisibleWidth : rightInvisibleWidth);
if (shrinkLeft) {
this.container.adjustScroll(-widthDelta, false);
const maxDelta = column.getWidth() - column.getMinWidth();
this.container.adjustScroll(-Math.min(widthDelta, maxDelta), false);
}
column.adjustWidth(-widthDelta, true);
}