diff options
3 files changed, 31 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java index 3585be1d60..29b7eb6d53 100644 --- a/client/src/com/vaadin/client/widgets/Escalator.java +++ b/client/src/com/vaadin/client/widgets/Escalator.java @@ -3105,6 +3105,15 @@ public class Escalator extends Widget implements RequiresResize, logicalTargetIndex); /* + * moveAndUpdateEscalatorRows recalculates the rows, but + * logical top row index bookkeeping is handled in this + * method. + * + * TODO: Redesign how to keep it easy to track this. + */ + updateTopRowLogicalIndex(-removedLogicalInside.length()); + + /* * Scrolling the body to the correct location will be * fixed automatically. Because the amount of rows is * decreased, the viewport is pushed up as the scrollbar diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/EscalatorBasicClientFeaturesTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/EscalatorBasicClientFeaturesTest.java index 517f657c62..5367d32328 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/EscalatorBasicClientFeaturesTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/EscalatorBasicClientFeaturesTest.java @@ -89,6 +89,13 @@ public abstract class EscalatorBasicClientFeaturesTest extends MultiBrowserTest protected static final String ROW_99 = "Row 99"; @Override + public void setup() throws Exception { + super.setup(); + + setDebug(true); + } + + @Override protected Class<?> getUIClass() { return EscalatorBasicClientFeatures.class; } @@ -272,6 +279,7 @@ public abstract class EscalatorBasicClientFeaturesTest extends MultiBrowserTest By.className("v-escalator-scroller-horizontal")); } + @Override protected Object executeScript(String script, Object... args) { return ((JavascriptExecutor) getDriver()).executeScript(script, args); } diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java index eb3d8672b3..7c50ae5d6e 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java @@ -295,6 +295,20 @@ public class GridStructureTest extends GridBasicFeaturesTest { filterSomeAndAssert(); } + @Test + public void testBareItemSetChangeWithBottomScrollAndSmallViewport() + throws Exception { + openTestURL(); + selectMenuPath("Component", "Size", "HeightMode Row"); + getGridElement().getRow(GridBasicFeatures.ROWS - 1); + // filter + selectMenuPath("Component", "Filter", "Column 1 starts with \"(23\""); + + String text = getGridElement().getCell(10, 0).getText(); + + assertFalse(text.isEmpty()); + } + private void filterSomeAndAssert() { selectMenuPath("Component", "Filter", "Column 1 starts with \"(23\""); boolean foundElements = false; |