mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-19 23:13:04 +08:00
fix softInputMode set too soon
This commit is contained in:
@ -232,6 +232,16 @@ function initializeDialogFragment() {
|
|||||||
owner._setupAsRootView(this.getActivity());
|
owner._setupAsRootView(this.getActivity());
|
||||||
owner._isAddedToNativeVisualTree = true;
|
owner._isAddedToNativeVisualTree = true;
|
||||||
|
|
||||||
|
// we need to set the window SoftInputMode here.
|
||||||
|
// it wont work is set in onStart
|
||||||
|
const window = this.getDialog().getWindow();
|
||||||
|
if (this._windowSoftInputMode !== undefined) {
|
||||||
|
window.setSoftInputMode(this._windowSoftInputMode);
|
||||||
|
} else {
|
||||||
|
// the dialog seems to not follow the default activity softinputmode,
|
||||||
|
// thus set we set it here.
|
||||||
|
window.setSoftInputMode((<androidx.appcompat.app.AppCompatActivity>owner._context).getWindow().getAttributes().softInputMode);
|
||||||
|
}
|
||||||
return owner.nativeViewProtected;
|
return owner.nativeViewProtected;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,20 +256,8 @@ function initializeDialogFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const owner = this.owner;
|
const owner = this.owner;
|
||||||
if (owner) {
|
if (owner && !owner.isLoaded) {
|
||||||
if (!owner.isLoaded) {
|
owner.callLoaded();
|
||||||
owner.callLoaded();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const window = this.getDialog().getWindow();
|
|
||||||
if (this._windowSoftInputMode !== undefined) {
|
|
||||||
window.setSoftInputMode(this._windowSoftInputMode);
|
|
||||||
} else {
|
|
||||||
// the dialog seems to not follow the default activity softinputmode,
|
|
||||||
// thus set we set it here.
|
|
||||||
window.setSoftInputMode((<androidx.appcompat.app.AppCompatActivity>owner._context).getWindow().getAttributes().softInputMode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._shownCallback();
|
this._shownCallback();
|
||||||
|
Reference in New Issue
Block a user