Skip to content

Commit a78c871

Browse files
committed
fix(framework): Allow role as a property name (#2290)
1 parent 16d9ebc commit a78c871

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/base/src/UI5Element.js

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const whitelist = [
44
"disabled",
55
"title",
66
"hidden",
7+
"role",
8+
"draggable",
79
];
810

911
/**

0 commit comments

Comments
 (0)