mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
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:
committed by
Nathan Walker
parent
988f372788
commit
b78996a569
@@ -63,7 +63,12 @@ export namespace ad {
|
|||||||
windowToken = nativeView.getWindowToken();
|
windowToken = nativeView.getWindowToken();
|
||||||
} else if (androidApp.foregroundActivity instanceof androidx.appcompat.app.AppCompatActivity) {
|
} else if (androidApp.foregroundActivity instanceof androidx.appcompat.app.AppCompatActivity) {
|
||||||
const decorView = androidApp.foregroundActivity.getWindow().getDecorView();
|
const decorView = androidApp.foregroundActivity.getWindow().getDecorView();
|
||||||
windowToken = decorView ? decorView.getWindowToken() : null;
|
if (decorView) {
|
||||||
|
windowToken = decorView.getWindowToken();
|
||||||
|
decorView.requestFocus();
|
||||||
|
} else {
|
||||||
|
windowToken = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputManager && windowToken) {
|
if (inputManager && windowToken) {
|
||||||
|
|||||||
Reference in New Issue
Block a user