Skip to content

Closing Dialog that has captured focus resets focus to start of document #968

@oyvind-stenhaug

Description

@oyvind-stenhaug

Steps to reproduce:

  1. Open https://www.sanity.io/ui/docs/component/dialog
  2. After the <Text>Content</Text> line in the editor, add <Button text="test" />
  3. Click "Open dialog"
  4. Press Esc (or Tab to focus the close button, then Enter)
  5. Press Tab

Expected result:
Should focus the "JSX" tab (I would expect it to "pick up where it left off")

Actual result:
Focuses "Read the blog post" link at the very top of the document

Or is every user of the Dialog component expected to code the logic for this themselves using the onClose callback? (If so, perhaps the example code should include that part too? It doesn't seem obvious to me.)

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