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: エリス <erisu@users.noreply.github.com>
Co-authored-by: Michael Goffioul <michael.goffioul@lincor.com>
This commit is contained in:
goffioul 2021-03-30 01:54:43 -04:00 committed by GitHub
parent e8ec3b1e37
commit 6cbf69d109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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