How to use the dialog-polyfill/dialog-polyfill.forceRegisterDialog function in dialog-polyfill

To help you get started, we’ve selected a few dialog-polyfill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ks888 / LambStatus / packages / frontend / src / utils / dialog.js View on Github external
export const mountDialog = (dialog) => {
  if (dialog) {
    document.getElementById(dialogID).appendChild(dialog)

    if (typeof HTMLDialogElement === 'function' || !dialog.showModal) {
      // There is some difference between dialog and its polyfill, and it breaks our layout.
      // To avoid this issue, always use polyfill.
      dialogPolyfill.forceRegisterDialog(dialog)
    }

    dialog.showModal()
  }
}

dialog-polyfill

Polyfill for the dialog element

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages