-
Notifications
You must be signed in to change notification settings - Fork 352
fix: set dialog title and description when provided to avoid Radix-ui error #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| <RadixDialog.Portal container={container}> | ||
| <RadixDialog.Overlay cmdk-overlay="" className={overlayClassName} /> | ||
| <RadixDialog.Content aria-label={props.label} cmdk-dialog="" className={contentClassName}> | ||
| {title && <RadixDialog.Title hidden>{title}</RadixDialog.Title>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RadixDialog.Title is set with hidden option, so its appearance doesn't change.
|
can we get this merged? I'm running into this error as well. |
|
Hi @pacocoursey 👋 |
|
Feels like the project is not maintained anymore. |
|
I also encountered this error, and hope to accept this PR quickly~ |
https://www.radix-ui.com/primitives/docs/components/dialog#title https://www.radix-ui.com/primitives/docs/utilities/visually-hidden |
resolve #337
Overview
Contentof radix-ui/react-dialog requiresTitleto set its accessible title, otherwise it provides the following error: "DialogContentrequires aDialogTitlefor the component to be accessible for screen reader users." Also, we would like to set accessible description withDescription.In #337, they showed some workaround to avoid that error, but I prefer the library itself provides a way to solve the issue.
This change will set the title component if
titleanddescriptionproperties ofCommand.Dialogis set.Reproduction
I create a reproduction to see how it works.