title: Expand input width dynamically to the length of string
body: <p>I am trying to create an <code>input</code> field that expands at least in width dynamically with the length of the string the user entered, probably even multiline.
  Is that possible with an <a href="https://material.angular.io/components/input/overview" rel="noreferrer"><code>input</code></a> element in Angular Material 2?</p>
  
  <p>With the <code>textarea</code> field from Angular Material 2 I only managed to expand the textarea in height, not in width with the following code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;mat-form-field (keydown.enter)="onEnter()" 
                  floatPlaceholder="never"&gt;
    &lt;textarea matInput 
              placeholder="Autosize textarea" 
              matTextareaAutosize
              matAutosizeMinRows="1" 
              matAutosizeMaxRows="8"&gt;
    &lt;/textarea&gt;
  &lt;/mat-form-field&gt;
  </code></pre>
  
  <p><a href="https://stackblitz.com/edit/angular-3ikrwd?file=app%2Finput-autosize-textarea-example.html" rel="noreferrer"><strong>also on StackBlitz</strong></a>.</p>
  
  <p>In case of the <code>textarea</code> the <code>scrollbar</code> should be invisible or replaced by a smaller one. And most important pressing <kbd>Enter</kbd> should not create a new line but trigger an action only.</p>