microsoft / microsoft/fluentui

[Bug]: Error - Dialog should have at least one focusable element inside DialogSurface

Open
#28,209 17 comments 0 reactions 2 assignees View on GitHub

@mshoho is already working on this.

Since Sep 4, 2023.

Component: Dialog Fluent UI react-components (v9) Resolution: Soft Close Status: In PR tabster
Dominant language
TypeScript
Stars
20.3k
Forks
2.9k
Avg merge
2d 9h
Merged PRs (30d)
46

Description

Library

React Components / v9 (@fluentui/react-components)

System Info
System:
    OS: Windows 10 10.0.22621
    CPU: (4) x64 Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
    Memory: 3.67 GB / 16.00 GB
  Browsers:
    Edge: Spartan (44.22621.1555.0), Chromium (112.0.1722.58)
    Internet Explorer: 11.0.22621.1
Are you reporting Accessibility issue?

None

Reproduction

https://codesandbox.io/s/sad-resonance-tlv9rv?file=/src/App.tsx

Bug Description

Actual Behavior

I copied code for the Dialog component from react.fluentui.dev from the stories section, particular for "Controlling Open And Close". And changed the initial state of the dialog to true:
const [open, setOpen] = React.useState(true);

In console I can see warnings stating the following:
"@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.
Please add at least a close button either on DialogTitle action slot or inside DialogActions
in Dialog (created by App)
in App "

Actually I see this behavior in my tests while rendering this component while I use control for open/close dialog. And I like to have test run to be clear, without any warnings.

Expected Behavior

As I have some buttons inside DialogActions section I shouldn't see this warning

Logs

No response

Requested priority

Normal

Products/sites affected

ImageMaster OfficeClient Add-In

Are you willing to submit a PR to fix?

no

Validations
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.