FocusScope
: the restoreFocus
prop doesn't restore the focus to the trigger element when one of the children elements have an autoFocus
prop
#2077
Unanswered
balazsmatepetro
asked this question in
Q&A
Replies: 2 comments
-
Same issue is reported in Reakit: ariakit/ariakit#855 but there is no resolution there too. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It seems like a bug from a quick look. I can reproduce it. Would you mind opening an Issue and linking it to this? |
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
-
First of all, I would like to say thank you for building this amazing library, it saved us a lot of time 🙏 .
As you can see in the title, I have a question about the
restoreFocus
prop of theFocusScope
component. When one of the children elements have anautoFocus
prop that element gets the focus, which is the expected behavior, it's fine. The problem occurs when I close theDialog
by pressing Esc. Unfortunately in this case the focus won't be restored on the trigger element, it goes to the<body>
instead.Is it the expected behavior, or did I found a bug? Here you can find an example that reproduces the above-mentioned behavior.
Looking forward to your answer.
Beta Was this translation helpful? Give feedback.
All reactions