Skip to content

Not possible to know when children are mounted for a11y focus-management #15

@chrisjpatty

Description

@chrisjpatty

When expanding or collapsing elements which contain inputs, it's a common accessibility pattern to focus the first focusable element. However, when I set the state to show, even when using the setState callback, the elements still haven't been mounted. This makes it not possible to reliably focus the first element. Can I propose an onMount event prop of some kind, that signals the parent component when the children have actually been mounted? If that sounds acceptable I'd be happy to look at creating a pull request myself. Thanks for all the hard work on this package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions