diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2021-03-10 14:59:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 14:59:27 +0200 |
commit | 99a43024ed0fcc60a7d60ceb4f2bfcf805230fa1 (patch) | |
tree | b288c3b0a49568b7dfbc54b193c2f318ed907080 /client | |
parent | 2274169423c45c42d1fe66463b00a7e4d8a7c877 (diff) | |
download | vaadin-framework-99a43024ed0fcc60a7d60ceb4f2bfcf805230fa1.tar.gz vaadin-framework-99a43024ed0fcc60a7d60ceb4f2bfcf805230fa1.zip |
Optimized #12211 fix. (#12234)
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/widgets/Escalator.java | 25 |
1 files changed, 6 insertions, 19 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 1a84bea3de..4ea6254b72 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -6118,10 +6118,8 @@ public class Escalator extends Widget root.getStyle().setHeight(height + defaultCellBorderBottomSize, Unit.PX); - if (!delayRepositioning) { - // move the visible spacers getRow row onwards. - shiftSpacerPositionsAfterRow(getRow(), heightDiff); - } + // move the visible spacers getRow row onwards. + shiftSpacerPositionsAfterRow(getRow(), heightDiff); /* * If we're growing, we'll adjust the scroll size first, then @@ -6187,7 +6185,7 @@ public class Escalator extends Widget tBodyScrollTop + moveDiff); verticalScrollbar.setScrollPosByDelta(moveDiff); - } else if (!delayRepositioning) { + } else { body.shiftRowPositions(getRow(), heightDiff); } @@ -6345,8 +6343,6 @@ public class Escalator extends Widget /** Width of the spacers' decos. Calculated once then cached. */ private double spacerDecoWidth = 0.0D; - private boolean delayRepositioning = false; - public void setSpacer(int rowIndex, double height) throws IllegalArgumentException { @@ -6389,18 +6385,9 @@ public class Escalator extends Widget void resetSpacer(int rowIndex) { if (spacerExists(rowIndex)) { - delayRepositioning = true; - double oldHeight = getSpacer(rowIndex).getHeight(); - removeSpacer(rowIndex); - // real height will be determined later - insertNewSpacer(rowIndex, 0); - // reposition content below this point to match lack of height, - // otherwise later repositioning will fail - if (oldHeight > 0) { - shiftSpacerPositionsAfterRow(rowIndex, -oldHeight); - body.shiftRowPositions(rowIndex, -oldHeight); - } - delayRepositioning = false; + SpacerImpl spacer = getSpacer(rowIndex); + destroySpacerContent(spacer); + initSpacerContent(spacer); } } |