]> source.dussan.org Git - vaadin-framework.git/commitdiff
Lock vertical scrolling while editor row is open (#13334)
authorJohannes Dahlström <johannesd@vaadin.com>
Wed, 27 Aug 2014 09:57:01 +0000 (12:57 +0300)
committerJohannes Dahlström <johannesd@vaadin.com>
Mon, 1 Sep 2014 08:49:59 +0000 (08:49 +0000)
Change-Id: Iee614d21b900900c7d969eca964f5fef829c70f2

client/src/com/vaadin/client/ui/grid/EditorRow.java
uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorRowTest.java

index 65e0eab0c18f47d73455ca20e79bf6127fe551c2..c57ae26ff31a8b00efdd223763d4b508077bf9a7 100644 (file)
@@ -24,6 +24,7 @@ import com.google.gwt.dom.client.TableRowElement;
 import com.google.gwt.event.dom.client.KeyCodes;
 import com.google.gwt.user.client.DOM;
 import com.vaadin.client.ui.grid.Escalator.AbstractRowContainer;
+import com.vaadin.client.ui.grid.ScrollbarBundle.Direction;
 import com.vaadin.shared.ui.grid.ScrollDestination;
 
 /**
@@ -105,6 +106,7 @@ public class EditorRow<T> {
                     "Cannot cancel edit: EditorRow is not in edit mode");
         }
         hideOverlay();
+        grid.getEscalator().setScrollLocked(Direction.VERTICAL, false);
         state = State.INACTIVE;
     }
 
@@ -132,6 +134,7 @@ public class EditorRow<T> {
     protected void show() {
         if (state == State.ACTIVATING) {
             state = State.ACTIVE;
+            grid.getEscalator().setScrollLocked(Direction.VERTICAL, true);
             showOverlay(grid.getEscalator().getBody().getRowElement(rowIndex));
         }
     }
index 29b5ff8f1b779a65d09423068f7a5eb8a3f41491..579d00dfd218f642a68dc9cec22b2a37d99d8e46 100644 (file)
@@ -19,6 +19,7 @@ import static org.junit.Assert.assertNotNull;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.openqa.selenium.NoSuchElementException;
 
 import com.vaadin.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest;
 
@@ -41,4 +42,10 @@ public class GridEditorRowTest extends GridBasicClientFeaturesTest {
         selectMenuPath("Component", "State", "Editor row", "Edit row 100");
         assertNotNull(getEditorRow());
     }
+
+    @Test(expected = NoSuchElementException.class)
+    public void testVerticalScrollLocking() throws Exception {
+        selectMenuPath("Component", "State", "Editor row", "Edit row 5");
+        getGridElement().getCell(200, 0);
+    }
 }