ClickableText will return position of clicked character but is it possible to make each word clickable and return it?
@Composable
fun SimpleClickableText() {
ClickableText(
text = AnnotatedString("Click Me"),
onClick = { offset ->
Log.d("ClickableText", "$offset -th character is clicked.")
}
)
}
for example I have this string -> "This is a sample text" and I want to click word "sample" and return it as string