microsoft / microsoft/fluentui
[Bug]: Error - Dialog should have at least one focusable element inside DialogSurface
@mshoho is already working on this.
Since Sep 4, 2023.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.