Skip to content

no-autofocus Enhancement: declarative, granular control #1062

@blue-infinex

Description

@blue-infinex

I'd like the ability to declare which components should be ignored e.g.

{
    "rules": {
        "jsx-a11y/no-autofocus": [2, {
            "ignoreNonDOM": ["Dialog", "Menu"]
        }],
    }
}

For context, I typically use "react-aria-components" to underpin the library and/or app I'm working on. The behaviour is nuanced and dependent on intent, it should still be respected in most cases:

<TextField autoFocus />
//         The autoFocus prop should not be used, as it can reduce usability
//         and accessibility for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions