title: Keep focus on input type text/search on keypress
body: <p>I've written a simple input of type text, but when I press enter while my cursor is inside the textbox, it looses the focus. How can I ignore enter key to stop losing focus from the text box? I tried doing something like this:</p>
  
  <pre><code>&lt;input type="text" (keyup)="keepFocus($event)" /&gt;
  </code></pre>
  
  <p>and keepFocus() is a method:</p>
  
  <pre><code>keepFocus(e) {
   e.target.select();
  }
  </code></pre>
  
  <p>But this method is called everytime I press a key, which is not very efficient. Is there a better solution to handle this behavior?</p>