Skip to content

Make clickOutsideDeactivates=true return the focus if the click target is not focusable #60

@egonolieux

Description

@egonolieux

I'm having an issue building a drawer component using a backdrop (shadow overlay). When the backdrop is clicked, the drawer should be closed. Setting clickOutsideDeactivates to true is required for the click event on the backdrop to be fired, but it seems that enabling this setting does not return the focus to the button used to activate the drawer.

This is understandable because the element clicked outside the focus trap might be a focusable element itself. Thats why I would suggest to add an extra config option to toggle if the focus should be returned, or do an extra check if the element outside is focusable.

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