Skip to content

Commit

Permalink
Fix Ctrl+Backspace in TextField (#329)
Browse files Browse the repository at this point in the history
Issue JetBrains/compose-multiplatform#2466

Co-Authored-By: Silas <[email protected]>

Co-authored-by: Silas <[email protected]>
  • Loading branch information
2 people authored and igordmn committed Nov 14, 2023
1 parent 40a3849 commit cecfb52
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ internal abstract class BaseTextPreparedSelection<T : BaseTextPreparedSelection<

private fun charOffset(offset: Int) =
offset.coerceAtMost(text.length - 1)
.coerceAtLeast(0)

private fun getParagraphStart() = text.findParagraphStart(selection.min)

Expand Down Expand Up @@ -429,4 +430,4 @@ internal class TextFieldPreparedSelection(
value.getOffsetForPosition(Offset(x, y))
)
}
}
}

0 comments on commit cecfb52

Please sign in to comment.