Compose Textfield Cursor Movement on Long-Press

132 views Asked by At

I am having an issue in my app with pasting text. When long-pressing at the end of a line within a BasicTextField (or TextField), as the Cut/Copy/Paste menu appears, the cursor jumps to the start of the next line.

This behaviour appears to be consistent, or sometimes it will randomly select some text on another line entirely.

I have tried to just include a TextField or BasicTextField in a blank project to see if it is consistent in a new project, or just something happening in my own larger project. The behaviour is identical in both projects. Please note that the TextFields in question have multiple lines of text, this issue would obviously not appear if there was just one line.

 val text = rememberSaveable(stateSaver = TextFieldValue.Saver) { mutableStateOf(TextFieldValue("This is some sample text\n\ntest\ntext\nsome more text\nmore text\n\nyou get the idea, multiple lines of text")) }

            TextField(
                value = text.value,
                onValueChange = { text.value = it },
                maxLines = Int.MAX_VALUE,
                modifier = Modifier.fillMaxSize()
            )
0

There are 0 answers