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 committed Oct 8, 2020
1 parent 16d9ebc commit a78c871
Show file tree
Hide file tree
Showing 2 changed files with 4 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
2 changes: 2 additions & 0 deletions packages/base/src/util/isValidPropertyName.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const whitelist = [
"disabled",
"title",
"hidden",
"role",
"draggable",
];

/**
Expand Down

0 comments on commit a78c871

Please sign in to comment.