Stop removing "on" prefix from event names in skooma

This commit is contained in:
Talia 2024-01-24 14:51:45 +01:00
parent b25a3013d2
commit 904a5daf7c

View file

@ -101,7 +101,7 @@ const setAttribute = (element, attribute, value, cleanupSignal) => {
if (isReactive(value))
setReactiveAttribute(element, attribute, value)
else if (typeof value === "function")
element.addEventListener(attribute.replace(/^on[A-Z]/, x => x.charAt(x.length-1).toLowerCase()), value, {signal: cleanupSignal})
element.addEventListener(attribute, value, {signal: cleanupSignal})
else if (special) {
special.set.call(element, value)
}