Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request]: Allow aria-label to suppress template-accessibility-elements-content violation #993

Open
abzats opened this issue Jan 13, 2021 · 1 comment

Comments

@abzats
Copy link

abzats commented Jan 13, 2021

Describe the bug

I'm facing an issue when I don't want to set explicit text content for a button element but I want to use aria-label for assistive technologies instead. In my current situation, I have a directive that adds icons to the button but without text.

Would it be possible for template-accessibility-elements-content to consider aria-label to be an acceptable alternative (either by default or as a rule option)?

Context and configuration

Please share:

  • Which rule is causing the problem
    template-accessibility-elements-content
  • What's the content of your tsconfig.json
{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "importHelpers": true,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "target": "ES2015",
    "module": "ESNext",
    "typeRoots": ["node_modules/@types"],
    "lib": ["ES2018", "DOM"]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "enableIvy": true
  }
}
  • What's the content of ~/.codelyzer.js (if applicable)
    I do not have it.

Expected behavior

<button class="btn-close" aria-label="close></button> should NOT produce an error.

Additional context

I believe a similar question about "aria-label" support might be raised to all others template-accessibility-* rules.

@rafaelss95
Copy link
Collaborator

@abzats I'm afraid we can't support this in Codelyzer as TSLint is out, you could open this in https://github.com/angular-eslint/angular-eslint/issues instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants