diff --git a/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/model/RichTextState.kt b/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/model/RichTextState.kt index 4259cc7e..c722de3c 100644 --- a/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/model/RichTextState.kt +++ b/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/model/RichTextState.kt @@ -2770,6 +2770,7 @@ public class RichTextState internal constructor( var pressY = pressPosition.y val textLayoutResult = this.textLayoutResult ?: return var index = 0 + var lastIndex = 0 // Get the length of the text val textLength = textLayoutResult.layoutInput.text.length