Fixes negative end selection offset. (flutter/engine#6171)

This commit is contained in:
Simon Lightfoot
2018-09-05 20:12:21 +01:00
committed by Jonah Williams
parent 605c146d02
commit 7ccb33b1c0

View File

@@ -158,7 +158,7 @@ class InputConnectionAdaptor extends BaseInputConnection {
int character = event.getUnicodeChar();
if (character != 0) {
int selStart = Math.max(0, Selection.getSelectionStart(mEditable));
int selEnd = Selection.getSelectionEnd(mEditable);
int selEnd = Math.max(0, Selection.getSelectionEnd(mEditable));
if (selEnd != selStart)
mEditable.delete(selStart, selEnd);
mEditable.insert(selStart, String.valueOf((char) character));