Assigned
Status Update
Comments
nj...@google.com <nj...@google.com>
si...@google.com <si...@google.com> #2
set the main component
ak...@gmail.com <ak...@gmail.com> #3
For now, as a workaround, we can add separator text with zero size, that is invisible in ui but is picked up when the text is selected:
/**
* Invisible text to separate text blocks in selected text.
*
* Workaround for [this issue](https://issuetracker.google.com/issues/285036739)
*/
@Composable
fun TextSelectionSeparator(text: String = "\n") {
Text(
modifier = Modifier.sizeIn(maxWidth = 0.dp, maxHeight = 0.dp),
text = text
)
}
SelectionContainer {
Column {
Text("111")
TextSelectionSeparator()
Text("222")
TextSelectionSeparator()
Text("333")
}
}
Description
I have a snippet like following:
Then the copy result is
"111222333"
, actually it should be"111\n222\n3333"
in some case, so ifSelectionContainer
can supportseparator
likejoinToString
, the copy result will be better