Bug 768106 - Ignore empty composing events when we have no composition string to replace. r=blassey

--HG--
extra : rebase_source : 1f236586a1d16b83798b0d10b0199ef01605b03e
This commit is contained in:
Chris Peterson 2012-07-16 14:28:09 -07:00
parent 8ba0124b9d
commit 729d8709f9

View File

@ -294,7 +294,16 @@ public class GeckoInputConnection
@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
// setComposingText will likely be called multiple times while we are composing text.
// setComposingText() places the given text into the editable, replacing any existing
// composing text. This method will likely be called multiple times while we are composing
// text.
// If the replacement composition string is empty and we have no active composition string
// to replace, then just ignore the empty string. Some VKBs, such as TouchPal Keyboard,
// send us empty strings at inopportune times, deleting committed text. See bug 768106.
if (text.length() == 0 && !hasCompositionString())
return true;
clampSelection();
return super.setComposingText(text, newCursorPosition);
}