You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error is similar to #2912 but the manifestation is different, where this error comes from an input with a type that doesn't match any of aria-query's mappings. A minimal reproduction is simply:
echo'<input type="password">'| npx ember-template-lint --verbose - --
-:- error attributes is not iterable undefined
TypeError: attributes is not iterable
at getImplicitRole (file:///Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/ember-template-lint/lib/rules/no-unsupported-role-attributes.js:18:31)
at NoUnsupportedRoleAttributes.ElementNode (file:///Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/ember-template-lint/lib/rules/no-unsupported-role-attributes.js:52:18)
at file:///Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/ember-template-lint/lib/rules/_base.js:323:46
at visitNode (/Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/traversal/traverse.js:86:14)
at visitArray (/Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/traversal/traverse.js:179:18)
at visitKey (/Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/traversal/traverse.js:155:5)
at visitNode (/Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/traversal/traverse.js:107:7)
at traverse (/Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/traversal/traverse.js:220:3)
at transform (/Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/ember-template-recast/lib/index.js:68:27)
at Linter.verify (file:///Users/jtw/.npm/_npx/279f7d8bf6868ccd/node_modules/ember-template-lint/lib/linter.js:381:11)
ember-template-lint's behavior prior to aria-query@5.2.1 was that inside getImplicitRole all of the key.attributes were iterable, they just didn't match and the return clause was never hit and we got the default behavior, which was to return a button. With how the data has changed in 5.2.1 some of the keys have no attributes defined so we get the error above.
I'm happy to work up a PR for a workaround but I'm a little confused about whether or not the current behavior where an input with a typeAttribute that doesn't match any of the aria-query element role mappings gets "defaulted" to a button is correct? Following the "it's gotten us this far" rule I suppose staying the course is fine and we can just keep returning button but if that existing behavior is a bug and what we really want is to fall back to something like an input of type text then I'm also happy to make that change.
The text was updated successfully, but these errors were encountered:
jaswilli
added a commit
to jaswilli/ember-template-lint
that referenced
this issue
Jun 17, 2023
This error is similar to #2912 but the manifestation is different, where this error comes from an input with a type that doesn't match any of aria-query's mappings. A minimal reproduction is simply:
ember-template-lint's behavior prior to aria-query@5.2.1 was that inside
getImplicitRole
all of thekey.attributes
were iterable, they just didn't match and the return clause was never hit and we got the default behavior, which was to return abutton
. With how the data has changed in 5.2.1 some of the keys have no attributes defined so we get the error above.Here's the relevant section of code:
ember-template-lint/lib/rules/no-unsupported-role-attributes.js
Lines 13 to 29 in 516d531
I'm happy to work up a PR for a workaround but I'm a little confused about whether or not the current behavior where an
input
with atypeAttribute
that doesn't match any of the aria-query element role mappings gets "defaulted" to abutton
is correct? Following the "it's gotten us this far" rule I suppose staying the course is fine and we can just keep returningbutton
but if that existing behavior is a bug and what we really want is to fall back to something like an input of type text then I'm also happy to make that change.The text was updated successfully, but these errors were encountered: