summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java3
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java5
2 files changed, 5 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 1fad13ea7b..50a41cd324 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -1779,8 +1779,7 @@ public class Grid<T> extends ResizeComposite implements
boolean bodyHasFocus = (containerWithFocus == escalator.getBody());
boolean insertionIsAboveFocusedCell = (added.getStart() <= rowWithFocus);
if (bodyHasFocus && insertionIsAboveFocusedCell) {
- setCellFocus(rowWithFocus + added.length(),
- cellFocusRange.getStart(), containerWithFocus);
+ rowWithFocus += added.length();
}
}
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 37e92830f3..337293d687 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
@@ -372,11 +372,14 @@ public class GridStructureTest extends GridBasicFeaturesTest {
setDebug(true);
openTestURL();
- getGridElement().scrollToRow(500);
+ GridCellElement cell = getGridElement().getCell(500, 1);
+ String cellContent = cell.getText();
selectMenuPath("Component", "Body rows", "Add first row");
assertFalse("Error notification was present",
isElementPresent(NotificationElement.class));
+
+ assertEquals("Grid scrolled unexpectedly", cellContent, cell.getText());
}
private void assertPrimaryStylename(String stylename) {