Remove preventDefault from inline event listeners

This commit is contained in:
Talia 2021-09-10 13:31:44 +02:00
parent 2e1ee0358c
commit 742eb36035
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

View file

@ -53,7 +53,7 @@ const parseArgs = (element, before, ...args) => {
else if (key == "shadowRoot") else if (key == "shadowRoot")
parseArgs((element.shadowRoot || element.attachShadow({mode: "open"})), null, arg[key]) parseArgs((element.shadowRoot || element.attachShadow({mode: "open"})), null, arg[key])
else if (typeof arg[key] === "function") else if (typeof arg[key] === "function")
element.addEventListener(key.replace(/^on[A-Z]/, x => x.charAt(x.length-1).toLowerCase()), e => e.preventDefault() || arg[key](e)) element.addEventListener(key.replace(/^on[A-Z]/, x => x.charAt(x.length-1).toLowerCase()), arg[key])
else if (arg[key] === true) else if (arg[key] === true)
{if (!element.hasAttribute(key)) element.setAttribute(key, '')} {if (!element.hasAttribute(key)) element.setAttribute(key, '')}
else if (arg[key] === false) else if (arg[key] === false)