提交 ca19ab0a 编写于 作者: J Jason Simmons 提交者: GitHub

Check for an empty selection in deleteSurroundingText (#3938)

Fixes https://github.com/flutter/flutter/issues/11437
上级 f2af3473
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册