Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
}
}