Skip to content

Commit

Permalink
fix: Username index out of bounds exception #WPB-12143 (#3605)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-zagorski authored Nov 7, 2024
1 parent 55863ae commit dc2d4b6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ fun InputTransformation.forceLowercase(): InputTransformation =

class ForceLowercaseTransformation : InputTransformation {
override fun TextFieldBuffer.transformInput() {
replace(0, length, asCharSequence().toString().lowercase())
val currentText = asCharSequence().toString()
val lowercasedText = currentText.lowercase()
if (currentText != lowercasedText) {
replace(0, length, lowercasedText)
}
}
}

Expand Down

0 comments on commit dc2d4b6

Please sign in to comment.