Skip to content

Commit 7a2f012

Browse files
committed
Deletion detection adjusted in MaskedTextChangedListener
1 parent 26ffcf8 commit 7a2f012

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ open class MaskedTextChangedListener(
120120
}
121121

122122
override fun onTextChanged(text: CharSequence, cursorPosition: Int, before: Int, count: Int) {
123-
val isDeletion: Boolean = before > 0
123+
val isDeletion: Boolean = before > 0 && count == 0
124124
val result: Mask.Result =
125125
this.mask.apply(
126126
CaretString(

0 commit comments

Comments
 (0)