no_autofocus
Enforce autofocus is not used on inputs. Autofocusing elements can cause usability issues for sighted and non-sighted users.
User impact: Serious
This rule supports the following configuration:
- TOML
- Shell
# The `autofocus` attribute must not be used.no_autofocus = true
# The `autofocus` attribute must not be used.curlylint --rule 'no_autofocus: true' .
#
Success- TOML
- Shell
<!-- Good: No autofocus attribute --><!-- no_autofocus = true --><input type="text" name="username" />
<!-- Good: No autofocus attribute --><!-- curlylint --rule 'no_autofocus: true' . --><input type="text" name="username" />
#
Fail- TOML
- Shell
<!-- Bad: autofocus present --><!-- no_autofocus = true --><input type="text" name="username" autofocus />
<!-- Bad: autofocus present --><!-- curlylint --rule 'no_autofocus: true' . --><input type="text" name="username" autofocus />