Open webdobe opened 4 years ago
Just wondering if any one has a work around for this?
I have content that has lines that have spaces to position the content (i'm getting the data like this, not my choice). In the UI I'm able to use a monospace font and css (white-space: pre-wrap;) to display the content the way i need to, but when it comes to exporting the data with this library I'm unable to use similar features.
Just wondering if @diegomura would have any advice to what I should do? or if you've found a work around your self @webdobe. If not thanks for the time any way!
I found an interesting workaround. Check this out:
<Text>{text.split('')}</Text>
Wow I've been thinking about this problem again recently, yeah that seems to have help fix my problem for now, Thank you very much @LitoMore!
I found an interesting workaround. Check this out:
<Text>{text.split('')}</Text>
Nice! Here is a version that keeps non-whitespace strings grouped:
text
.split(/(\s{2,})/g)
.reduce((strings, string, index) => strings.concat(index % 2 ? string.split('') : string), []);
// returns [ 'Text', ' ', ' ', ' ', ' ', ' ', 'with the proper spacing' ]
@danomatic This doesn't work well with strings with dashes, for example '44D1F7B6-558F-40DD-9252-45BB11DD34D5-44D1F7B6-558F-40DD-9252-45BB11DD34D5'
@chathu-novade You could polish @danomatic's code for your case.
@chathu-novade You could polish @danomatic's code for your case.
Seems I have to use soft hyphen to make it work since word-break support is not available.
Is your feature request related to a problem? Please describe. I would like to implement https://www.w3schools.com/cssref/css3_pr_text-overflow.asp on a View / Text component that clips off long text
Describe the solution you'd like Based on the docs it does not look like overflow and white space css properties are supported.
Describe alternatives you've considered Not sure I have any.