You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even if I write a Title inside Content, the following error occurs
`DialogContent` requires a `DialogTitle` for the component to be accessible for screen reader users.If you want to hide the `DialogTitle`, you can wrap it with our VisuallyHidden component.For more information, see ...
We need to figure out how error validation logic works.
See
constTitleWarning: React.FC<TitleWarningProps>=({ titleId })=>{consttitleWarningContext=useWarningContext(TITLE_WARNING_NAME);constMESSAGE=`\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;React.useEffect(()=>{if(titleId){consthasTitle=document.getElementById(titleId);if(!hasTitle)console.error(MESSAGE);}},[MESSAGE,titleId]);returnnull;};
Additional context
useId and VisuallyHidden do not work.
This also applies to description related warnings.
Your environment
Software
Name(s)
Version
Radix Package(s)
"@radix-ui/react-dialog
1.1.6
React
n/a
18
Browser
chrome
134.0.6998.118
Assistive tech
Node
n/a
20
npm/yarn/pnpm
yarn
4
Operating System
mac
14
The text was updated successfully, but these errors were encountered:
Fixing error validate logic requires the maintainer's opinion(Maybe it's not worth fixing.). However, as the name of TitleWarning suggests, I'm going to try fixing it to console.warn instead of console.error. Is that okay?
In a completely different way, there is also a way to prevent errors by injecting shadow host ref when using shadow DOM. (It might be a bit annoying for developers, though haha)
// for ex..<DialogContentshadowHost={ref.current}>{children}</DialogContent>consthasTitle=host ? host.shadowRoot.geElementById() : document.getElementById()
Bug report
Current Behavior
Expected behavior
Reproducible example
CodeSandbox Template
Suggested solution
We need to figure out how error validation logic works.
See
Additional context
useId
andVisuallyHidden
do not work.This also applies to description related warnings.
Your environment
The text was updated successfully, but these errors were encountered: