Fixes negative end selection offset. (flutter/engine#6171)
This commit is contained in:
committed by
Jonah Williams
parent
605c146d02
commit
7ccb33b1c0
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user