зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1014244 - Make backspacing work with single-character compositions. r=wesj
This commit is contained in:
Родитель
40c49912f7
Коммит
8f2e39c9e7
|
@ -368,8 +368,7 @@ public class ToolbarEditText extends CustomEditText
|
|||
return super.deleteSurroundingText(beforeLength, afterLength);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setComposingText(final CharSequence text, final int newCursorPosition) {
|
||||
private boolean removeAutocompleteOnComposing(final CharSequence text) {
|
||||
final Editable editable = getText();
|
||||
final int composingStart = BaseInputConnection.getComposingSpanStart(editable);
|
||||
final int composingEnd = BaseInputConnection.getComposingSpanEnd(editable);
|
||||
|
@ -381,7 +380,24 @@ public class ToolbarEditText extends CustomEditText
|
|||
removeAutocomplete(editable)) {
|
||||
// Make the IME aware that we interrupted the setComposingText call,
|
||||
// by having finishComposingText() send change notifications to the IME.
|
||||
return super.finishComposingText();
|
||||
finishComposingText();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commitText(CharSequence text, int newCursorPosition) {
|
||||
if (removeAutocompleteOnComposing(text)) {
|
||||
return false;
|
||||
}
|
||||
return super.commitText(text, newCursorPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setComposingText(final CharSequence text, final int newCursorPosition) {
|
||||
if (removeAutocompleteOnComposing(text)) {
|
||||
return false;
|
||||
}
|
||||
return super.setComposingText(text, newCursorPosition);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче