Skip to content

Commit

Permalink
Merge pull request #892 from wordpress-mobile/fix/dont-disable-select…
Browse files Browse the repository at this point in the history
…ion-listener-on-first-char-delete

Last char is when the length is now zero
  • Loading branch information
mchowning authored Feb 7, 2020
2 parents d2baefd + 2e5536d commit 5138fed
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 5138fed

Please sign in to comment.