Remove preventDefault from inline event listeners

This commit is contained in:
Talia 2021-09-10 13:31:44 +02:00
parent 3c50558773
commit bf50ea22dc

View file

@ -53,7 +53,7 @@ const parseArgs = (element, before, ...args) => {
else if (key == "shadowRoot")
parseArgs((element.shadowRoot || element.attachShadow({mode: "open"})), null, arg[key])
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)
{if (!element.hasAttribute(key)) element.setAttribute(key, '')}
else if (arg[key] === false)