File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -171,11 +171,17 @@ function prepareAndCreateAlertDialog(
171
171
return ;
172
172
}
173
173
//ensure we hide any keyboard
174
- const imm = ad . getApplicationContext ( ) . getSystemService ( android . content . Context . INPUT_METHOD_SERVICE ) ;
175
- imm . toggleSoftInput ( android . view . inputmethod . InputMethodManager . HIDE_IMPLICIT_ONLY , 0 ) ;
176
174
onDoneCalled = true ;
177
175
if ( options . view instanceof View ) {
178
176
Utils . android . dismissSoftInput ( options . view . nativeView ) ;
177
+ } else {
178
+ const activity = ( Application . android . foregroundActivity || Application . android . startActivity ) as globalAndroid . app . Activity ;
179
+ const context = ad . getApplicationContext ( ) as android . content . Context ;
180
+ const view = activity != null ? activity . getCurrentFocus ( ) : null ;
181
+ if ( view ) {
182
+ const imm = context . getSystemService ( android . content . Context . INPUT_METHOD_SERVICE ) as android . view . inputmethod . InputMethodManager ;
183
+ imm . hideSoftInputFromWindow ( view . getWindowToken ( ) , 0 ) ;
184
+ }
179
185
}
180
186
if ( dialog ) {
181
187
dialog . cancel ( ) ;
You can’t perform that action at this time.
0 commit comments