title: How to make button in mat-dialog work on Enter also?
body: <p>I have a <code>mat-dialog-box</code> where on click event it closes the dialog but I want it to work on <kbd>Enter</kbd> press also. Is there any way to do so?</p>
  <p>I have tried using a form but didn't work. Below is my solution what I tried to use:</p>
  <p><strong>HTML</strong></p>
  <pre><code>&lt;form (submit)=&quot;doAction()&quot;&gt;
     &lt;button type=&quot;submit&quot;&gt;Add&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  <p><strong>TS</strong></p>
  <pre><code>doAction() {
    this.dialogRef.close({ event: this.action, data: this.local_data });
  }
  </code></pre>
  <p>But the <kbd>Enter</kbd> event is not occurring though on click it's submitting the data. Also for normal forms (which is not in a dialog) works on <kbd>Enter</kbd> press if I take the above HTML approach.</p>
  <p>Can anyone suggest the issue?</p>