title: Preventing new line in textarea
body: <p>I'm working on a chat feature (using Vue) and am using a textarea for my input so the overflow wraps and is more readable for users writing longer messages. Unfortunately, when the user keys down enter and submits, the cursor moves to a new line before submitting, making the UX feel off. Any ideas for how I could disable the newline on submit using vanilla Javascript? As you can see, I've tried adding a replace() function but to no avail.</p>
  
  <p>My textarea:</p>
  
  <pre><code>&lt;textarea id="btn-input" type="text" class="input-group_input" rows="4"
     placeholder="Type your message here..." v-model="body" 
     @keydown.enter="postReply()"&gt;
   &lt;/textarea&gt;
  </code></pre>
  
  <p>My submit method:</p>
  
  <pre><code>postReply() {
    this.$http.post('/api/chat/' + this.session.id + '/replies', {
      body: this.body
      }).then((response) =&gt; {
        this.body.replace(/(\r\n|\n|\r)/gm,'');
        this.body = '';
        this.replies.unshift(response.data);
      }).catch((error) =&gt; {
  
      })
  },
  </code></pre>