diff options
-rw-r--r-- | client/src/com/vaadin/client/widgets/Grid.java | 8 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java | 17 |
2 files changed, 21 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 9cd42199c7..cb3735c141 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -6462,10 +6462,10 @@ public class Grid<T> extends ResizeComposite implements final int key = event.getKeyCode(); final boolean editorIsActive = editor.getState() != Editor.State.INACTIVE; - final boolean openEvent = type == Event.ONDBLCLICK - || (type == Event.ONKEYDOWN && key == Editor.KEYCODE_SHOW); + final boolean openEvent = eventCell.isBody() + && (type == Event.ONDBLCLICK || (type == Event.ONKEYDOWN && key == Editor.KEYCODE_SHOW)); - final boolean moveEvent = type == Event.ONCLICK; + final boolean moveEvent = eventCell.isBody() && type == Event.ONCLICK; final boolean closeEvent = type == Event.ONKEYDOWN && key == Editor.KEYCODE_HIDE; @@ -6477,7 +6477,7 @@ public class Grid<T> extends ResizeComposite implements return true; - } else if (editorIsActive && eventCell.isBody() && moveEvent) { + } else if (editorIsActive && moveEvent) { editor.hide(); cellFocusHandler.setCellFocus(eventCell); diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java index b724ce4aa4..4c4b1c6f8b 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java @@ -188,6 +188,23 @@ public abstract class GridEditorTest extends GridBasicFeaturesTest { } + @Test + public void testNoOpenFromHeaderOrFooter() { + selectMenuPath("Component", "Footer", "Visible"); + + getGridElement().getHeaderCell(0, 0).doubleClick(); + assertEditorClosed(); + + new Actions(getDriver()).sendKeys(Keys.ENTER).perform(); + assertEditorClosed(); + + getGridElement().getFooterCell(0, 0).doubleClick(); + assertEditorClosed(); + + new Actions(getDriver()).sendKeys(Keys.ENTER).perform(); + assertEditorClosed(); + } + protected WebElement getSaveButton() { return getDriver().findElement(By.className("v-grid-editor-save")); } |