C
C
Cyril2020-10-27 12:41:19
JavaScript
Cyril, 2020-10-27 12:41:19

Regular season. Instead of a space / enter, it cuts off the word on some phones, what's the problem?

Good day everyone!
Essence, on samsungs (android 8,9,10), xiaomi (android 9), ZTE (android 9), the following code

this.space_text = this.main_text.replace(/ /g, '<br/>')
this.space_text = this.space_text.replace(/\r\n|\r|\n/g, "< br/ >")

instead of replacing the space and enter with , it simply removes the last word, but if you put a space at the end, then everything is ok. The text is entered dynamically into the textarea and output to the p tag, via the v-model. Thank you! <br/>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question