[Bug]: Dialog Focus Issue
Component
Accordion
Package version
@fluentui/react-components ^9.72.
React version
@types/react 18.3.18.
Environment
Mac OS: 26.4.1 (25E253)
Google Chrome
Current Behavior
Hi there!
We're seeing a focus management issue with nested dialogs. When a second dialog is opened over an existing one, closing the second dialog causes focus to be lost rather than returning to the original dialog.
We can consistently reproduce this issue for a similar use case. I
Expected Behavior
Focus should go back to initial dialog
Reproduction
https://stackblitz.com/edit/vitejs-vite-react-ts-dpbfkkhd?file=package.json,src%2FApp.tsx
Steps to reproduce
In stackblitz
Are you reporting an Accessibility issue?
None
Suggested severity
Urgent - No workaround and Products/sites are affected
Products/sites affected
No response
Are you willing to submit a PR to fix?
no
Validations
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] The provided reproduction is a minimal reproducible example of the bug.
Hello! After some investigation, we believe that this is not a bug, rather it's a bad usage case. In nested dialogues, like your example, they are meant to be open programmatically and, once closed, the focus needs to be restored manually. See this for reference: https://storybooks.fluentui.dev/react/?path=/docs/utilities-focus-management-userestorefocussource--docs
Thanks for the follow up here @paolo-aliprandi 💪🏼