Skip to content

Return focus on outside click does not respect "returnFocusOnDeactivate" value #103

@Tckool

Description

@Tckool

After this issue: #60, the click handler returns the focus to the focus trap if the new target is not clickable. However, this happens even if the returnFocusOnDeactivate configuration option is passed in as false: https://github.com/davidtheclark/focus-trap/blob/master/index.js#L111-L114

Because I have set returnFocusOnDeactivate to false, I was expecting that the focus trap would not return the focus. I feel like it should respect that configuration value and only return the focus when it is set to true and the new target is not clickable.

It was confusing for me so I am just wondering if this is intentional or if it is a bug. If it is intentional, I'm curious as to why, and if it is just a bug, I would be happy to open a PR to fix it.

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