@servlyadmin/runtime-core 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -0
- package/dist/index.js +12 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -19569,6 +19569,18 @@ function attachEventHandlers(domElement, element, eventHandlers, context, elemen
|
|
|
19569
19569
|
}
|
|
19570
19570
|
}
|
|
19571
19571
|
}
|
|
19572
|
+
if (isRootElement && context.props && state?.renderingStack?.size === 0) {
|
|
19573
|
+
for (const [propName, value] of Object.entries(context.props)) {
|
|
19574
|
+
if (propName.startsWith("on") && propName.length > 2 && typeof value === "function") {
|
|
19575
|
+
const domEventName = propName.slice(2).toLowerCase();
|
|
19576
|
+
if (!elementState.eventListeners.has(domEventName)) {
|
|
19577
|
+
const handler = value;
|
|
19578
|
+
elementState.eventListeners.set(domEventName, handler);
|
|
19579
|
+
domElement.addEventListener(domEventName, handler);
|
|
19580
|
+
}
|
|
19581
|
+
}
|
|
19582
|
+
}
|
|
19583
|
+
}
|
|
19572
19584
|
}
|
|
19573
19585
|
function detachEventHandlers(elementState) {
|
|
19574
19586
|
for (const [eventName, handler] of elementState.eventListeners) {
|
package/dist/index.js
CHANGED
|
@@ -2773,6 +2773,18 @@ function attachEventHandlers(domElement, element, eventHandlers, context, elemen
|
|
|
2773
2773
|
}
|
|
2774
2774
|
}
|
|
2775
2775
|
}
|
|
2776
|
+
if (isRootElement && context.props && state?.renderingStack?.size === 0) {
|
|
2777
|
+
for (const [propName, value] of Object.entries(context.props)) {
|
|
2778
|
+
if (propName.startsWith("on") && propName.length > 2 && typeof value === "function") {
|
|
2779
|
+
const domEventName = propName.slice(2).toLowerCase();
|
|
2780
|
+
if (!elementState.eventListeners.has(domEventName)) {
|
|
2781
|
+
const handler = value;
|
|
2782
|
+
elementState.eventListeners.set(domEventName, handler);
|
|
2783
|
+
domElement.addEventListener(domEventName, handler);
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2776
2788
|
}
|
|
2777
2789
|
function detachEventHandlers(elementState) {
|
|
2778
2790
|
for (const [eventName, handler] of elementState.eventListeners) {
|