diff options
author | Artur Signell <artur@vaadin.com> | 2016-09-02 08:19:35 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2016-09-05 09:55:59 +0000 |
commit | 83a1b8a0961cc9b2d43e01757530cefd035b0a22 (patch) | |
tree | 894da0b70ae36f836f9a8115a3876df6350f0c4b /client | |
parent | e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a (diff) | |
download | vaadin-framework-83a1b8a0961cc9b2d43e01757530cefd035b0a22.tar.gz vaadin-framework-83a1b8a0961cc9b2d43e01757530cefd035b0a22.zip |
Update DOM and update escalator row count in the correct order (#19442)
If you show a column when Grid has no horizontal scrollbar, and is scrolled
all the way down, and the number of visible rows is slightly more than N then
Escalator will adjust the row count when the scrollbar is shown so that N-1
rows are visible. During this operation, the DOM must be updated for the new
column.
Change-Id: I0b6c845f96a57be1d64ef4e735aa2f77efbe589a
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/widgets/Escalator.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java index 52f981fe63..d867907996 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -4166,6 +4166,11 @@ public class Escalator extends Widget implements RequiresResize, frozenColumns += numberOfColumns; } + // Add to DOM + header.paintInsertColumns(index, numberOfColumns, frozen); + body.paintInsertColumns(index, numberOfColumns, frozen); + footer.paintInsertColumns(index, numberOfColumns, frozen); + // this needs to be before the scrollbar adjustment. boolean scrollbarWasNeeded = horizontalScrollbar.getOffsetSize() < horizontalScrollbar .getScrollSize(); @@ -4173,14 +4178,12 @@ public class Escalator extends Widget implements RequiresResize, boolean scrollbarIsNowNeeded = horizontalScrollbar.getOffsetSize() < horizontalScrollbar .getScrollSize(); if (!scrollbarWasNeeded && scrollbarIsNowNeeded) { + // This might as a side effect move rows around (when scrolled + // all the way down) and require the DOM to be up to date, i.e. + // the column to be added body.verifyEscalatorCount(); } - // Add to DOM - header.paintInsertColumns(index, numberOfColumns, frozen); - body.paintInsertColumns(index, numberOfColumns, frozen); - footer.paintInsertColumns(index, numberOfColumns, frozen); - // fix initial width if (header.getRowCount() > 0 || body.getRowCount() > 0 || footer.getRowCount() > 0) { |