https://kotlinlang.org logo
#jewel
Title
# jewel
h

Harish Ramanbhai Patel

03/26/2024, 9:49 PM
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.
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
👍 1
2 Views