You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2021/03/30 05:54:49 UTC

[cordova-android] branch master updated: fix: restore key event handlers when DOM element is fullscreen (#1157)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new 6cbf69d  fix: restore key event handlers when DOM element is fullscreen (#1157)
6cbf69d is described below

commit 6cbf69d109cccb2189537f27fa53bcf203490732
Author: goffioul <mi...@gmail.com>
AuthorDate: Tue Mar 30 01:54:43 2021 -0400

    fix: restore key event handlers when DOM element is fullscreen (#1157)
    
    * GH-1156: Restore key event handlers when a DOM element is fullscreen
    
    Make sure to call dispatchKeyEvent from base class in WrapperView, if
    the event hasn't been handled by the engine.
    
    * Remove unwanted whitespace in condition
    
    Co-authored-by: エリス <er...@users.noreply.github.com>
    Co-authored-by: Michael Goffioul <mi...@lincor.com>
---
 framework/src/org/apache/cordova/CordovaWebViewImpl.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java
index 8fa313a..92579a8 100644
--- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java
+++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java
@@ -265,7 +265,12 @@ public class CordovaWebViewImpl implements CordovaWebView {
 
         @Override
         public boolean dispatchKeyEvent(KeyEvent event) {
-            return engine.getView().dispatchKeyEvent(event);
+            boolean ret = engine.getView().dispatchKeyEvent(event);
+            if (!ret) {
+                // If the engine didn't handle the event, handle it normally.
+                ret = super.dispatchKeyEvent(event);
+            }
+            return ret;
         }
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org