fix(android): when hiding the keyboard make view lose focus to match ios behavior (#9786)

Hiding the keyboard on iOS loses focus; this makes Android match when no view argument is provided.
This commit is contained in:
Ian MacDonald
2022-02-18 18:25:40 -05:00
committed by Nathan Walker
parent 988f372788
commit b78996a569

View File

@@ -63,7 +63,12 @@ export namespace ad {
windowToken = nativeView.getWindowToken();
} else if (androidApp.foregroundActivity instanceof androidx.appcompat.app.AppCompatActivity) {
const decorView = androidApp.foregroundActivity.getWindow().getDecorView();
windowToken = decorView ? decorView.getWindowToken() : null;
if (decorView) {
windowToken = decorView.getWindowToken();
decorView.requestFocus();
} else {
windowToken = null;
}
}
if (inputManager && windowToken) {