Skip to content

Commit

Permalink
fix(framework): Allow role as a property name (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladitasev authored Oct 5, 2020
1 parent 93772fb commit a816cef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/base/src/UI5Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ class UI5Element extends HTMLElement {
const properties = this.getMetadata().getProperties();
for (const [prop, propData] of Object.entries(properties)) { // eslint-disable-line
if (!isValidPropertyName(prop)) {
throw new Error(`"${prop}" is not a valid property name. Use a name that does not collide with DOM APIs`);
console.warn(`"${prop}" is not a valid property name. Use a name that does not collide with DOM APIs`); /* eslint-disable-line */
}

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

const propertyName = slotData.propertyName || slotName;
Expand Down
1 change: 1 addition & 0 deletions packages/base/src/util/isValidPropertyName.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const allowList = [
"disabled",
"title",
"hidden",
"role",
"draggable",
];

Expand Down

0 comments on commit a816cef

Please sign in to comment.