summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Motornyi <elmot@vaadin.com>2018-03-26 10:03:44 +0300
committerGitHub <noreply@github.com>2018-03-26 10:03:44 +0300
commit7370e68fd52e0a2918d91fede5dddf3bb6e674f7 (patch)
treee596f363b42b754e92fc191f3a54ef00b0e9fe26
parent00c3f2c37c104498e23bd8f25dfd5ab8ce65294b (diff)
downloadvaadin-framework-7370e68fd52e0a2918d91fede5dddf3bb6e674f7.tar.gz
vaadin-framework-7370e68fd52e0a2918d91fede5dddf3bb6e674f7.zip
Fix grid spacebar handling (#10750)
* Fix spacebar handling
-rw-r--r--client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java3
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorUnbufferedTest.java4
2 files changed, 4 insertions, 3 deletions
diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java
index 59c78b313d..799a4c4d00 100644
--- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java
+++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java
@@ -40,7 +40,8 @@ public class SpaceSelectHandler<T> {
@Override
public void onKeyDown(GridKeyDownEvent event) {
- if (event.getNativeKeyCode() != KeyCodes.KEY_SPACE || spaceDown) {
+ if (event.getNativeKeyCode() != KeyCodes.KEY_SPACE || spaceDown
+ || grid.isEditorActive()) {
return;
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorUnbufferedTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorUnbufferedTest.java
index 9a751a70b5..928d827348 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorUnbufferedTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorUnbufferedTest.java
@@ -233,14 +233,14 @@ public class GridEditorUnbufferedTest extends GridEditorTest {
editor.clear();
// Click to ensure IE focus...
editor.click(5, 5);
- editor.sendKeys("Foo", Keys.ENTER);
+ editor.sendKeys("Foo Bar", Keys.ENTER);
assertEquals("Editor did not move.", "(6, 0)",
getGridElement().getEditor().getField(0).getAttribute("value"));
assertEquals("Editor field value did not update from server.", "6",
getGridElement().getEditor().getField(3).getAttribute("value"));
- assertEquals("Edited value was not saved.", "Foo",
+ assertEquals("Edited value was not saved.", "Foo Bar",
getGridElement().getCell(5, 0).getText());
}
}