mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(android): add check in ad.dismissSoftInput to make sure the dismissed nativeView has focus at that moment (#8720)
closes https://github.com/NativeScript/NativeScript/issues/8713
This commit is contained in:
@@ -62,6 +62,9 @@ export module ad {
|
||||
let windowToken: android.os.IBinder;
|
||||
|
||||
if (nativeView instanceof android.view.View) {
|
||||
if (!nativeView.hasFocus()) {
|
||||
return;
|
||||
}
|
||||
windowToken = nativeView.getWindowToken();
|
||||
} else if (androidApp.foregroundActivity instanceof androidx.appcompat.app.AppCompatActivity) {
|
||||
const decorView = androidApp.foregroundActivity.getWindow().getDecorView();
|
||||
@@ -159,4 +162,4 @@ export module ad {
|
||||
|
||||
return fingerprint != null && (fingerprint.indexOf("vbox") > -1 || fingerprint.indexOf("generic") > -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user