Skip to content

Commit dc2d4b6

Browse files
authored
fix: Username index out of bounds exception #WPB-12143 (#3605)
1 parent 55863ae commit dc2d4b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/src/main/kotlin/com/wire/android/ui/common/textfield/InputTransformations.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ fun InputTransformation.forceLowercase(): InputTransformation =
9090

9191
class ForceLowercaseTransformation : InputTransformation {
9292
override fun TextFieldBuffer.transformInput() {
93-
replace(0, length, asCharSequence().toString().lowercase())
93+
val currentText = asCharSequence().toString()
94+
val lowercasedText = currentText.lowercase()
95+
if (currentText != lowercasedText) {
96+
replace(0, length, lowercasedText)
97+
}
9498
}
9599
}
96100

0 commit comments

Comments
 (0)