Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 976 Bytes

File metadata and controls

47 lines (34 loc) · 976 Bytes

ember/template-no-input-placeholder

Disallows placeholder attribute on input elements.

Rule Details

The placeholder attribute should not be used as it has accessibility issues. Use proper labels instead.

Examples

Examples of incorrect code for this rule:

<template>
  <input placeholder="Enter username" />
</template>
<template>
  <input type="text" placeholder="Username" />
</template>

Examples of correct code for this rule:

<template>
  <label>
    Username
    <input type="text" />
  </label>
</template>
<template>
  <input type="text" aria-label="Username" />
</template>

References