Skip to content

Commit a816cef

Browse files
authored
fix(framework): Allow role as a property name (#2290)
1 parent 93772fb commit a816cef

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/base/src/UI5Element.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ class UI5Element extends HTMLElement {
890890
const properties = this.getMetadata().getProperties();
891891
for (const [prop, propData] of Object.entries(properties)) { // eslint-disable-line
892892
if (!isValidPropertyName(prop)) {
893-
throw new Error(`"${prop}" is not a valid property name. Use a name that does not collide with DOM APIs`);
893+
console.warn(`"${prop}" is not a valid property name. Use a name that does not collide with DOM APIs`); /* eslint-disable-line */
894894
}
895895

896896
if (propData.type === Boolean && propData.defaultValue) {
@@ -946,7 +946,7 @@ class UI5Element extends HTMLElement {
946946
const slots = this.getMetadata().getSlots();
947947
for (const [slotName, slotData] of Object.entries(slots)) { // eslint-disable-line
948948
if (!isValidPropertyName(slotName)) {
949-
throw new Error(`"${slotName}" is not a valid property name. Use a name that does not collide with DOM APIs`);
949+
console.warn(`"${slotName}" is not a valid property name. Use a name that does not collide with DOM APIs`); /* eslint-disable-line */
950950
}
951951

952952
const propertyName = slotData.propertyName || slotName;

packages/base/src/util/isValidPropertyName.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const allowList = [
44
"disabled",
55
"title",
66
"hidden",
7+
"role",
78
"draggable",
89
];
910

0 commit comments

Comments
 (0)