ember/template-no-invalid-interactive

April 20, 2026 ยท View on GitHub

๐Ÿ’ผ This rule is enabled in the ๐Ÿ“‹ template-lint-migration config.

Disallow non-interactive elements with interactive handlers

Rule Details

This rule prevents adding interactive event handlers (like onclick, onkeydown, etc.) to non-interactive HTML elements without proper ARIA roles.

Examples

Examples of incorrect code for this rule:

<template>
  <div onclick={{this.handleClick}}>Click me</div>
</template>
<template>
  <span onkeydown={{this.handleKey}}>Press key</span>
</template>

Examples of correct code for this rule:

<template>
  <button onclick={{this.handleClick}}>Click me</button>
</template>
<template>
  <div role="button" onclick={{this.handleClick}}>Click me</div>
</template>
<template>
  <button {{on "click" this.handleClick}}>Click me</button>
</template>

Options

NameTypeDefaultDescription
additionalInteractiveTagsstring[][]Extra tag names to treat as interactive.
ignoredTagsstring[][]Tag names to skip checking.
ignoreTabindexbooleanfalseIf true, tabindex does not make an element interactive.
ignoreUsemapbooleanfalseIf true, usemap does not make an element interactive.

References