Skip to content

Commit 5138fed

Browse files
authored
Merge pull request #892 from wordpress-mobile/fix/dont-disable-selection-listener-on-first-char-delete
Last char is when the length is now zero
2 parents d2baefd + 2e5536d commit 5138fed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/watchers/ZeroIndexContentWatcher.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ class ZeroIndexContentWatcher(aztecText: AztecText) : TextWatcher {
2727

2828
val aztecText = aztecTextRef.get()
2929
// last character was removed
30-
if (aztecText != null && textChangedEventDetails.inputEnd == 0 && textChangedEventDetails.inputStart == 1) {
30+
if (aztecText != null
31+
&& text.length == 0
32+
&& textChangedEventDetails.inputEnd == 0
33+
&& textChangedEventDetails.inputStart == 1) {
3134
aztecText.disableOnSelectionListener()
3235
}
3336
}

0 commit comments

Comments
 (0)