Skip to content

Should LWC support autofocus? #771

@caridy

Description

@caridy

In the general sense of autofocus, I believe it should not be allowed, just like we don't support arbitrary tabindex because:

  • it will make it hard to implement in synthetic mode (uff, I think @davidturissini and @ekashida will agree)
  • a component should not be able to hijack the page, just like an input will never hijack the page.

But in a recent discussion (whatwg/html#833) new information arise about autofocus, and how that might work in the context of the shadow. I'm not 100% sure I have a full understanding of the implications, but that's why I'm opening this issue, to investigate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions