duplicate-id
This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.
Reported when two elements in one render carry the same literal id, and both are always present.
An id is the one name a document promises is unique, and more is built on that promise than
it looks: getElementById and #x answer with the first and never mention the second, a
<label for> labels the first — so the other control is nameless in the accessibility tree,
not just visually — and aria-labelledby, aria-describedby and a fragment link all resolve
the same way.
Nothing fails while this happens. The page renders and the second element is simply unreachable by the name it was given.
If the two are the same control in two states, give them one element. If they are two controls, give them two ids — and if the markup repeats, build the id from the row's own identity rather than writing it in.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.