fix softInputMode set too soon

This commit is contained in:
Martin Guillon
2020-11-16 09:44:58 +01:00
parent 7d75c6f42c
commit 99a11e832c

View File

@ -232,6 +232,16 @@ function initializeDialogFragment() {
owner._setupAsRootView(this.getActivity());
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;
}
@ -246,22 +256,10 @@ function initializeDialogFragment() {
}
const owner = this.owner;
if (owner) {
if (!owner.isLoaded) {
if (owner && !owner.isLoaded) {
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();
}