An element takes focus by itself when the page loads, with autoFocus
What it finds
Focus that jumps to a field on load scrolls the page and skips the content before it, so screen reader users miss it and keyboard users lose their place.
Reported are autoFocus and autofocus attributes that are not set to false.
From the rule's source, focus_taken_on_load.rs.
Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:focus-taken-on-load" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:focus-taken-on-load] reason="..."tx0 explain tx0/ts:focus-taken-on-load shows the same in the terminal. Found a false positive? Report it.