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