John Brunner John Brunner - 1 year ago 64
HTML Question

Textarea: Allow to begin with linebreak

I'm developing an Ionic/Cordova App. There is an

visible where user can input some data, which is transferred to the server.

Problem I face right now is that user can input line breaks, but just after they already inputted a character, but it is not possible to begin with an line break. The
will cut out the beginning line breaks. How can I achieve my goal?

looks like that:

<textarea ng-model="card.text" id="text-message" rows="20"></textarea>

Thank you.

Answer Source

According to you can apply ng-trim="false" to your element to stop this behaviour like so:

<textarea ng-model="card.text" ng-trim="false" id="text-message" rows="20"></textarea>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download