aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-06-10 16:26:35 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2015-06-10 17:08:52 +0300
commit2c78ee9406adb4ccaeec2ef33c33ff7a218c97ed (patch)
treefa25b7b4c4d58d5f448c22b461040f1fd38408ca /client
parent9abd1e5f9fc3989d98a581d3d437aa0a53bbbb17 (diff)
downloadvaadin-framework-2c78ee9406adb4ccaeec2ef33c33ff7a218c97ed.tar.gz
vaadin-framework-2c78ee9406adb4ccaeec2ef33c33ff7a218c97ed.zip
Add a workaround to not display a spacer just scrolled to view (#17826)
Change-Id: I22805530cca26a23a6cc15c94b396aaba1f1245b
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/widgets/Escalator.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java
index 3990683e64..7cce34fa22 100644
--- a/client/src/com/vaadin/client/widgets/Escalator.java
+++ b/client/src/com/vaadin/client/widgets/Escalator.java
@@ -4845,9 +4845,17 @@ public class Escalator extends Widget implements RequiresResize,
final double bodyBottom, final double decoWidth) {
final int top = deco.getAbsoluteTop();
final int bottom = deco.getAbsoluteBottom();
+ /*
+ * FIXME
+ *
+ * Height and its use is a workaround for the issue where
+ * coordinates of the deco are not calculated yet. This will
+ * prevent a deco from being displayed when it's added to DOM
+ */
+ final int height = bottom - top;
if (top < bodyTop || bottom > bodyBottom) {
final double topClip = Math.max(0.0D, bodyTop - top);
- final double bottomClip = decoHeight
+ final double bottomClip = height
- Math.max(0.0D, bottom - bodyBottom);
// TODO [optimize] not sure how GWT compiles this
final String clip = new StringBuilder("rect(")
@@ -4903,6 +4911,8 @@ public class Escalator extends Widget implements RequiresResize,
} else if (spacerExists(rowIndex)) {
removeSpacer(rowIndex);
}
+
+ updateSpacerDecosVisibility();
}
/** Checks if a given element is a spacer element */
@@ -4994,8 +5004,6 @@ public class Escalator extends Widget implements RequiresResize,
spacerScrollerRegistration.removeHandler();
spacerScrollerRegistration = null;
}
-
- updateSpacerDecosVisibility();
}
public Map<Integer, SpacerImpl> getSpacers() {
@@ -5306,7 +5314,6 @@ public class Escalator extends Widget implements RequiresResize,
initSpacerContent(spacer);
body.sortDomElements();
- updateSpacerDecosVisibility();
}
private void updateExistingSpacer(int rowIndex, double newHeight) {