Replies: 1 comment
-
I was able to work around this issue by using the
This feels awkward and almost like it should be built-in, so I'm hoping 🙏 someone can tell me I shouldn't do this and there's an easier way. But perhaps, this isn't a common use case? Custom
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm having difficulty getting a
Dialog
to return focus to the lastdocument.activeElement
on the page. This works properly when using aDialogTrigger
element within aDialog
, but in my case, I would like theDialog
to be controlled as a separate component and have the triggering button not be colocated within theDialog
.When a button (outside of the dialog) causes the Dialog to open and the dialog is closed, the focus goes to the
document.body
. Is there a way to programmatically set the dialog's triggerRef?In most cases, there is a trigger button to initiate the Dialog, I need to display a dialog when the user hasn't interacted with the page over a given time. These dialogs are triggered using a
useEffect
without an element that triggered it.Is this by design, or am I just overlooking something obvious?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions