Skip to content

Commit a033326

Browse files
authored
fix: unknown slots no longer cause an error (#90)
1 parent ff93da8 commit a033326

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ class WebComponent extends HTMLElement {
165165
const autoIncrementMap = new Map();
166166
domChildren.forEach(child => {
167167
const slot = child.getAttribute("data-ui5-slot") || this.constructor.getMetadata().getDefaultSlot();
168-
if (slotsMap[slot] === "undefined") {
168+
if (slotsMap[slot] === undefined) {
169+
const validValues = Object.keys(slotsMap).join(", ");
170+
console.warn(`Unknown data-ui5-slot value: ${slot}, ignoring`, child, `Valid data-ui5-slot values are: ${validValues}`); // eslint-disable-line
169171
return;
170172
}
171173
let slotName;

0 commit comments

Comments
 (0)