Skip to content

Commit a8deebf

Browse files
author
ellieshen
committed
feat: 修复剪切粘贴bug
1 parent 1671dd6 commit a8deebf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

android/src/main/java/com/variabletextinput/view/VariableTextInput.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public VariableTextInput(Context context) {
8686
@Override
8787
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
8888
mPreviousText = s.toString();
89+
mSpanLength = -1;
8990
if (start == 0 || editText.getText() == null) return;
9091
if (count > after) {
9192
TextSpan[] spans = editText.getText().getSpans(start + count, start + count, TextSpan.class);
@@ -220,6 +221,7 @@ private Editable handleSelectData() {
220221
int spanStart = mEditable.getSpanStart(span);
221222
int spanEnd = mEditable.getSpanEnd(span);
222223
mEditable.replace(spanStart, spanEnd, text);
224+
mEditable.removeSpan(span);
223225
}
224226
return mEditable;
225227
}

0 commit comments

Comments
 (0)