dialog-polyfill
dialog-polyfill copied to clipboard
How to determine if one should load the polyfill
Kindly expose a function to determine if the modal element is already present so that the CSS styles can be loaded dynamically.
I know one can check the forceRegister function but having a standard API helps reduce a lot of confusion
My solution:
let dialog = document.createElement('dialog')
let polyfillNeeded = (!dialog.showModal || !dialog.close)