Remove preventDefault from inline event listeners
This commit is contained in:
parent
3c50558773
commit
bf50ea22dc
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue