For a regular EditText, we can get the cursor position by calling the getSelectionStart() method. In Jetpack Compose this posibility is available for ClickableText, but apparently not for TextField or OutlinedTextField.
Has anyone come across this problem and know how to solve it?
That is because
EditTextis stateful.Composables are stateless.
In the case of
BasicTextField()and related composables, use the composable where your state isTextFieldValue. Then, theselectionproperty of theTextFieldValuehas aTextRangethat you can use to get the cursor position.