summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-11-24 11:31:23 +0200
committerVaadin Code Review <review@vaadin.com>2016-11-28 06:49:13 +0000
commit7041760d1295cef8847bdae1de02636d9a2cd250 (patch)
treee2fe4e977dcb76fb5fd23e3c80f391cf32b9f0e8 /client
parente944b2bda4bb8df30eaa1bcc991a48a135f79bb8 (diff)
downloadvaadin-framework-7041760d1295cef8847bdae1de02636d9a2cd250.tar.gz
vaadin-framework-7041760d1295cef8847bdae1de02636d9a2cd250.zip
Re-add body rows when Escalator is reattached to DOM (#20477)
Change-Id: I0ae9144817db3bb730c80748d5e9190484b323e7
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/widgets/Escalator.java48
1 files changed, 14 insertions, 34 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 39f996aa84..4bd61cb53c 100644
--- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java
+++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java
@@ -5791,40 +5791,6 @@ public class Escalator extends Widget
header.paintInsertRows(0, header.getRowCount());
footer.paintInsertRows(0, footer.getRowCount());
- // recalculateElementSizes();
-
- Scheduler.get().scheduleDeferred(new Command() {
- @Override
- public void execute() {
- /*
- * Not a faintest idea why we have to defer this call, but
- * unless it is deferred, the size of the escalator will be 0x0
- * after it is first detached and then reattached to the DOM.
- * This only applies to a bare Escalator; inside a Grid
- * everything works fine either way.
- *
- * The three autodetectRowHeightLater calls above seem obvious
- * suspects at first. However, they don't seem to have anything
- * to do with the issue, as they are no-ops in the
- * detach-reattach case.
- */
- recalculateElementSizes();
- }
- });
-
- /*
- * Note: There's no need to explicitly insert rows into the body.
- *
- * recalculateElementSizes will recalculate the height of the body. This
- * has the side-effect that as the body's size grows bigger (i.e. from 0
- * to its actual height), more escalator rows are populated. Those
- * escalator rows are then immediately rendered. This, in effect, is the
- * same thing as inserting those rows.
- *
- * In fact, having an extra paintInsertRows here would lead to duplicate
- * rows.
- */
-
boolean columnsChanged = false;
for (ColumnConfigurationImpl.Column column : columnConfiguration.columns) {
boolean columnChanged = column.measureAndSetWidthIfNeeded();
@@ -5851,6 +5817,20 @@ public class Escalator extends Widget
} else {
scroller.attachTouchListeners(getElement());
}
+
+ /*
+ * Note: There's no need to explicitly insert rows into the body.
+ *
+ * recalculateElementSizes will recalculate the height of the body. This
+ * has the side-effect that as the body's size grows bigger (i.e. from 0
+ * to its actual height), more escalator rows are populated. Those
+ * escalator rows are then immediately rendered. This, in effect, is the
+ * same thing as inserting those rows.
+ *
+ * In fact, having an extra paintInsertRows here would lead to duplicate
+ * rows.
+ */
+ recalculateElementSizes();
}
@Override