title: MDC web components: mdc-dialog doesn't close properly sometimes
body: <p>I use MDC-Web components. I'm opening and closing a dialog programmatically, but sometimes it doesn't close. I don't know if I am doing the right way in order to close the dialog.</p>
  
  <pre><code>closeDialog('dialog_gui');
  
  function closeDialog(elementId){
      let dialog = new mdc.dialog.MDCDialog(document.getElementById(elementId));
      dialog.close();
  }
  </code></pre>