Skip to content

Commit 4ffce64

Browse files
authored
fix: prevent throwing exception if slotted child does not have listenFor (#92)
1 parent 3efe10b commit 4ffce64

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/base/src/sap/ui/webcomponents/base/WebComponent.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,12 @@ class WebComponent extends HTMLElement {
355355
return;
356356
}
357357

358-
const { observedProps, notObservedProps } = this.parentNode._monitoredChildProps.get(prop.target.getAttribute("data-ui5-slot"));
358+
const propsMetadata = this.parentNode._monitoredChildProps.get(this.getAttribute("data-ui5-slot"));
359+
360+
if (!propsMetadata) {
361+
return;
362+
}
363+
const { observedProps, notObservedProps } = propsMetadata;
359364

360365
if (observedProps.includes(prop.detail.name) && !notObservedProps.includes(prop.detail.name)) {
361366
this.parentNode._invalidate("_parent_", this);

0 commit comments

Comments
 (0)