jsx-dom-cjs
Advanced tools
Comparing version 8.0.2 to 8.0.3
@@ -0,1 +1,4 @@ | ||
# 8.0.3 | ||
- Added: [RFC Support capture events, fix custom events, support on/onCapture](https://github.com/alex-kinokon/jsx-dom/pull/70) | ||
# 8.0.2 | ||
@@ -2,0 +5,0 @@ - Bug fix: `import("jsx-dom").ShadowRoot` was not properly exported. |
14
index.js
@@ -434,2 +434,9 @@ /* eslint-disable */ | ||
return | ||
case "on": | ||
case "onCapture": | ||
forEach(value, (eventHandler, eventName) => { | ||
node.addEventListener(eventName, eventHandler, key === "onCapture") | ||
}) | ||
return | ||
} | ||
@@ -440,7 +447,10 @@ | ||
const attribute = key.toLowerCase() | ||
const useCapture = attribute.endsWith("capture") | ||
if (node[attribute] == null) { | ||
if (!useCapture && node[attribute] === null) { | ||
node[attribute] = value | ||
} else if (useCapture) { | ||
node.addEventListener(attribute.substring(2, attribute.length - 7), value, true) | ||
} else { | ||
node.addEventListener(key, value) | ||
node.addEventListener(attribute.substring(2), value) | ||
} | ||
@@ -447,0 +457,0 @@ } |
@@ -284,2 +284,9 @@ /* eslint-disable */ | ||
return | ||
case "on": | ||
case "onCapture": | ||
forEach(value, (eventHandler, eventName) => { | ||
node.addEventListener(eventName, eventHandler, key === "onCapture") | ||
}) | ||
return | ||
} | ||
@@ -290,7 +297,10 @@ | ||
const attribute = key.toLowerCase() | ||
const useCapture = attribute.endsWith("capture") | ||
if (node[attribute] == null) { | ||
if (!useCapture && node[attribute] === null) { | ||
node[attribute] = value | ||
} else if (useCapture) { | ||
node.addEventListener(attribute.substring(2, attribute.length - 7), value, true) | ||
} else { | ||
node.addEventListener(key, value) | ||
node.addEventListener(attribute.substring(2), value) | ||
} | ||
@@ -297,0 +307,0 @@ } |
{ | ||
"name": "jsx-dom-cjs", | ||
"version": "8.0.2", | ||
"version": "8.0.3", | ||
"description": "JSX to document.createElement.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128942
3194