1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

<input/> element must have a text alternative, even though it does

Discussão em 'Angular' iniciado por UncleBob, Junho 3, 2025.

  1. UncleBob

    UncleBob Guest

    First ESLint kept complaining that there were click handlers without keydown events and focus, so I changed the code from:

    <img src="start-button.png" alt="Start Button" class="start-button" (click)="startSequence()">


    To this:

    <input type="image" src="start-button.png" alt="Start Button" class="start-button" (click)="startSequence()"/>


    While that got rid of those messages. It leaves me stuck at a point where I can't seem to go on. Namely, it now produces this message:

    <input/> element must have a text alternative @angular-eslint/template/alt-text


    As you can see above, the element has an alt attribute. But I didn't just leave it at that. I also tried name, aria-label and aria-labelledby, and all of them at the same time. The message won't go away.

    What do I have to do to satisfy that rule? The documentation just keeps telling me to do the things I already did.

    Continue reading...

Compartilhe esta Página