'SwiftUI text wrapping disabled on click interaction using `.textSelection(.enabled)`
I'm creating an error message dialog in swiftUI and I'd like the user to be able to copy and paste the error message from the dialog. I use Text like this to achieve that:
ScrollView {
Text(debugMessage)
.padding(.horizontal, 20)
.padding(.top, 10)
.textSelection(.enabled)
}.padding(.bottom, 20)
And it looks fine at first (placeholder error message):
But once the user clicks on the error message it collapses and looks like this:
This is not a problem functionally since the user can still select all of the text and paste it into google or our GitHub issues. However it looks ridiculous and feels unpolished so I'd really like to get to the bottom of this. Any ideas??
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


