Skip to content

Bug - Popover - FocusTrap returns focus on deactivation even though withFocusTrap prop is set to false #9863

@jschuler

Description

@jschuler

Describe the problem
I have a Popover that opens up and informs the user about validation status when a user types in a TextInput.
Since the Popover is tied to the TextInput, I don't want it to steal focus when opened, so I set withFocusTrap={false}.
However, even then, when the popover is closed, it returns focus to the TextInput which is not desired since I want to control the TextInput onBlur onFocus etc myself.

Perhaps a possible fix might be to update the returnFocusOnDeactivate prop passed to the Popover FocusTrap, so that instead of true it could be set to withFocusTrapProp?

Before
https://github.com/patternfly/patternfly-react/assets/869106/0a933d76-48d0-4fd4-85fd-45b6995c202c

Now (bug)
https://github.com/patternfly/patternfly-react/assets/869106/8030ec25-4fb2-4522-9679-597cf94ae076

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions