Prevent default on skooma event listeners
This commit is contained in:
parent
9f78a9bf14
commit
d670416c7a
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ const parseArgs = (element, args) => {
|
||||||
else
|
else
|
||||||
for (let key in arg)
|
for (let key in arg)
|
||||||
if (typeof arg[key] == "function")
|
if (typeof arg[key] == "function")
|
||||||
element.addEventListener(key.replace(/^on[A-Z]/, x => x.charAt(x.length-1).toLowerCase()), arg[key])
|
element.addEventListener(key.replace(/^on[A-Z]/, x => x.charAt(x.length-1).toLowerCase()), e => e.preventDefault() || arg[key](e))
|
||||||
else
|
else
|
||||||
element.setAttribute(key, parseAttribute(arg[key]))
|
element.setAttribute(key, parseAttribute(arg[key]))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue