I have TextArea composable and would like to paste some text at current cursor position. How would I get the current cursor position? Little that I researched, found that interactionSource may provide that, but not sure how to access it.
Harish Ramanbhai Patel
04/01/2024, 12:14 PM
Yes, it is a Compose thing. Was able to use the TextArea() constructor which takes value parameter of type TextFieldValue instead of String. It provides cursor position via val selection: TextRange object.
cc @seb