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(
171171 return ;
172172 }
173173 //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 ) ;
176174 onDoneCalled = true ;
177175 if ( options . view instanceof View ) {
178176 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+ }
179185 }
180186 if ( dialog ) {
181187 dialog . cancel ( ) ;
You can’t perform that action at this time.
0 commit comments