From 2e5536de838129e94fb31df17fdf0fc89a1543de Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Fri, 7 Feb 2020 14:59:35 +0200 Subject: [PATCH] Last char is when the length is now zero --- .../org/wordpress/aztec/watchers/ZeroIndexContentWatcher.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/watchers/ZeroIndexContentWatcher.kt b/aztec/src/main/kotlin/org/wordpress/aztec/watchers/ZeroIndexContentWatcher.kt index f1ec4eae0..a391eb58e 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/watchers/ZeroIndexContentWatcher.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/watchers/ZeroIndexContentWatcher.kt @@ -27,7 +27,10 @@ class ZeroIndexContentWatcher(aztecText: AztecText) : TextWatcher { val aztecText = aztecTextRef.get() // last character was removed - if (aztecText != null && textChangedEventDetails.inputEnd == 0 && textChangedEventDetails.inputStart == 1) { + if (aztecText != null + && text.length == 0 + && textChangedEventDetails.inputEnd == 0 + && textChangedEventDetails.inputStart == 1) { aztecText.disableOnSelectionListener() } }