fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Bug]: Dialog Focus Issue

Open itimie opened this issue 6 months ago • 2 comments

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

Stackblitz

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.

itimie avatar May 07 '26 22:05 itimie

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

paolo-aliprandi avatar May 11 '26 09:05 paolo-aliprandi

Thanks for the follow up here @paolo-aliprandi 💪🏼

bsunderhus avatar Jun 12 '26 08:06 bsunderhus