Skip to content

Commit

Permalink
Fix crash in no-unsupported-role-attributes rule (#2917)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswilli committed Jun 17, 2023
1 parent 516d531 commit 71bf8bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-unsupported-role-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function createUnsupportedAttributeErrorMessage(attr, role, element) {
function getImplicitRole(element, typeAttribute) {
if (element === 'input') {
for (let key of elementRoles.keys()) {
if (key.name === element) {
if (key.name === element && key.attributes) {
let attributes = key.attributes;
for (let attribute of attributes) {
if (attribute.name === 'type' && attribute.value === typeAttribute) {
Expand Down
1 change: 1 addition & 0 deletions test/unit/rules/no-unsupported-role-attributes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ generateRuleTests({
'{{other-component role=this.role aria-bogus="true"}}',
'<ItemCheckbox @model={{@model}} @checkable={{@checkable}} />',
'<some-custom-element />',
'<input type="password">',
],

bad: [
Expand Down

0 comments on commit 71bf8bb

Please sign in to comment.