Skip to content

[Popover] Could we switch off initialFocus? #1679

Open
@sebinsua

Description

@sebinsua

Feature request

Summary

I've noticed that Popover has an initialFocus prop that can take a ref or function returning a ref. By default it focuses the popup.

I'd like to be able to switch off initial focus.

Note, I've tried to pass in the background element that I need to keep focus but it doesn't seem to work.

Examples in other libraries

floating-ui#FloatingFocusManager supports a negative number to ignore the initialFocus therefore, I am actually able to pass in -1 into Popover and it'll do as expected but I will get a type error.

Motivation

I sometimes use this component to display transient flyouts that show information (and only gain focus if you interact with them). I need another element on the page to maintain its focus because it reacts to keyboard shortcuts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: popoverThis is the name of the generic UI component, not the React module!enhancementThis is not a bug, nor a new featurehas workaround

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions