Skip to content

Commit

Permalink
fix: restore key event handlers when DOM element is fullscreen (#1157)
Browse files Browse the repository at this point in the history
* 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: エリス <erisu@users.noreply.github.com>
Co-authored-by: Michael Goffioul <michael.goffioul@lincor.com>
  • Loading branch information
3 people authored Mar 30, 2021
1 parent e8ec3b1 commit 6cbf69d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion framework/src/org/apache/cordova/CordovaWebViewImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,12 @@ public WrapperView(Context context, CordovaWebViewEngine engine) {

@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;
}
}

Expand Down

0 comments on commit 6cbf69d

Please sign in to comment.