Check for an empty selection in deleteSurroundingText (flutter/engine#3938)

Fixes https://github.com/flutter/flutter/issues/11437
This commit is contained in:
Jason Simmons
2017-07-31 16:18:27 -07:00
committed by GitHub
parent 62108dc53e
commit dc8f103ca8

View File

@@ -90,6 +90,10 @@ class InputConnectionAdaptor extends BaseInputConnection {
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
if (Selection.getSelectionStart(mEditable) == -1 ||
Selection.getSelectionStart(mEditable) == -1)
return true;
boolean result = super.deleteSurroundingText(beforeLength, afterLength);
updateEditingState();
return result;