Skip to content

Commit ed48168

Browse files
committed
refactor: additional comment
1 parent dcef0e4 commit ed48168

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

android/src/main/java/com/swmansion/enriched/textinput/utils/MaxLengthFilter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ object MaxLength {
4444
): Int {
4545
if (cut <= start || cut >= end) return cut
4646

47+
// here we handle potential composing characters - emojis,
48+
// surrogate pairs, etc. We don't want to split them in half
4749
val iterator = BreakIterator.getCharacterInstance()
4850
iterator.setText(text.subSequence(start, end).toString())
4951

0 commit comments

Comments
 (0)