diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-21 10:24:12 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-21 10:24:12 +0300 |
commit | fa6f39bc84fa94f876248f6e967a3c9cefcd097b (patch) | |
tree | 29644e1376a93fec862f185da221845346265fad /client/src | |
parent | 1bb67a02544e0fbf2999e5a814c79475d1b05c9b (diff) | |
parent | b2f283b414129407f4e839470380e5e5d0383fb4 (diff) | |
download | vaadin-framework-fa6f39bc84fa94f876248f6e967a3c9cefcd097b.tar.gz vaadin-framework-fa6f39bc84fa94f876248f6e967a3c9cefcd097b.zip |
Merge remote-tracking branch 'origin/master' into feature/mavenize
Change-Id: I1c55d6158caf32b796a9ad0d9e8df5392812e9a6
Diffstat (limited to 'client/src')
3 files changed, 13 insertions, 4 deletions
diff --git a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java index 2a9a8d4204..e5d5ea8a25 100644 --- a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java +++ b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java @@ -188,9 +188,10 @@ public class ServerRpcQueue { * Triggers a send of server RPC and legacy variable changes to the server. */ public void flush() { - if (flushScheduled) { + if (flushScheduled || isEmpty()) { return; } + flushPending = true; flushScheduled = true; Scheduler.get().scheduleFinally(scheduledFlushCommand); diff --git a/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java b/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java index 9ffb9cfba9..6f4872729d 100644 --- a/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java @@ -507,8 +507,16 @@ public class UIConnector extends AbstractSingleComponentContainerConnector @Override public void onKeyDown(KeyDownEvent event) { if (getWidget().actionHandler != null) { - getWidget().actionHandler.handleKeyboardEvent((Event) event - .getNativeEvent().cast()); + Element target = Element.as(event.getNativeEvent() + .getEventTarget()); + if (target == Document.get().getBody() + || getWidget().getElement().isOrHasChild(target)) { + // Only react to body and elements inside the UI + getWidget().actionHandler + .handleKeyboardEvent((Event) event + .getNativeEvent().cast()); + } + } } }, KeyDownEvent.getType()); diff --git a/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java b/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java index c2752f1953..7b0d886c39 100644 --- a/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java +++ b/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java @@ -20,7 +20,7 @@ import org.junit.Test; /** * - * @since + * @since 7.7 * @author Vaadin Ltd */ public class ServerMessageHandlerTest { |