Bug 1181969 - Typing one letter hides the keyboard, r=mcomella

This commit is contained in:
Mark Capella 2015-07-13 20:15:47 -04:00
Родитель 86564eb5cd
Коммит 417c9610fd
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -96,7 +96,7 @@ public class FindInPageBar extends LinearLayout implements TextWatcher, View.OnC
}
public void hide() {
if (!mInflated) {
if (!mInflated || getVisibility() == View.GONE) {
// There's nothing to hide yet.
return;
}
@ -104,8 +104,13 @@ public class FindInPageBar extends LinearLayout implements TextWatcher, View.OnC
// Always clear the Find string, primarily for privacy.
mFindText.setText("");
// Only close the IMM if its EditText is the one with focus.
if (mFindText.isFocused()) {
getInputMethodManager(mFindText).hideSoftInputFromWindow(mFindText.getWindowToken(), 0);
}
// Close the FIPB / FindHelper state.
setVisibility(GONE);
getInputMethodManager(mFindText).hideSoftInputFromWindow(mFindText.getWindowToken(), 0);
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("FindInPage:Closed", null));
}