From 7ca490f619144f564c118dfa39fdc7cb33577f2b Mon Sep 17 00:00:00 2001 From: Henrik Paul Date: Thu, 28 Aug 2014 17:38:43 +0300 Subject: [PATCH] Fixes a missing/superfluous row in column modifications (#13334) Change-Id: If31ea7154b13daf99845757202ce7d8395af89fc --- .../com/vaadin/client/ui/grid/Escalator.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/client/src/com/vaadin/client/ui/grid/Escalator.java b/client/src/com/vaadin/client/ui/grid/Escalator.java index af23fdd70a..e87eb8bdae 100644 --- a/client/src/com/vaadin/client/ui/grid/Escalator.java +++ b/client/src/com/vaadin/client/ui/grid/Escalator.java @@ -3611,8 +3611,15 @@ public class Escalator extends Widget { horizontalScrollbar.setScrollPos(newScrollLeft); } + boolean scrollbarWasNeeded = horizontalScrollbar + .getOffsetSize() < horizontalScrollbar.getScrollSize(); // this needs to be after the scroll position adjustment above. scroller.recalculateScrollbarsForVirtualViewport(); + boolean scrollbarIsStillNeeded = horizontalScrollbar + .getOffsetSize() < horizontalScrollbar.getScrollSize(); + if (scrollbarWasNeeded && !scrollbarIsStillNeeded) { + body.verifyEscalatorCount(); + } } } @@ -3678,13 +3685,20 @@ public class Escalator extends Widget { } if (hasColumnAndRowData()) { + // this needs to be before the scrollbar adjustment. + boolean scrollbarWasNeeded = horizontalScrollbar + .getOffsetSize() < horizontalScrollbar.getScrollSize(); + scroller.recalculateScrollbarsForVirtualViewport(); + boolean scrollbarIsNowNeeded = horizontalScrollbar + .getOffsetSize() < horizontalScrollbar.getScrollSize(); + if (!scrollbarWasNeeded && scrollbarIsNowNeeded) { + body.verifyEscalatorCount(); + } + header.paintInsertColumns(index, numberOfColumns, frozen); body.paintInsertColumns(index, numberOfColumns, frozen); footer.paintInsertColumns(index, numberOfColumns, frozen); - // this needs to be before the scrollbar adjustment. - scroller.recalculateScrollbarsForVirtualViewport(); - int pixelsToInsertedColumn = columnConfiguration .getCalculatedColumnsWidth(Range.withLength(0, index)); final boolean columnsWereAddedToTheLeftOfViewport = scroller.lastScrollLeft > pixelsToInsertedColumn; -- 2.39.5