[Popover] Could we switch off initialFocus
?
#1679
Labels
component: popover
This is the name of the generic UI component, not the React module!
enhancement
This is not a bug, nor a new feature
has workaround
Feature request
Summary
I've noticed that
Popover
has aninitialFocus
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 theinitialFocus
therefore, I am actually able to pass in-1
intoPopover
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.
The text was updated successfully, but these errors were encountered: