Skip to content

Commit 58918d4

Browse files
committed
fix(Dialog): suppress missing Description warning when no description provided (#976)
Radix warns when DialogContent has no DialogDescription rendered. Now renders a hidden RadixDialog.Description by default so the warning is suppressed without requiring consumers to pass a description prop or aria-describedby={undefined}.
1 parent 1d9804e commit 58918d4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clickhouse/click-ui": patch
3+
---
4+
5+
Suppress Radix `Missing Description` console warning when no `description` prop is provided to `Dialog.Content`. A hidden `RadixDialog.Description` is now rendered by default so Radix's accessibility check passes silently.

src/components/Dialog/Dialog.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ const DialogContent = ({
163163
<Spacer size="sm" />
164164
</>
165165
)}
166-
{description && <Description>{description}</Description>}
166+
{description ? (
167+
<Description>{description}</Description>
168+
) : (
169+
<RadixDialog.Description hidden />
170+
)}
167171
{children}
168172
</ContentArea>
169173
</RadixDialog.Portal>

0 commit comments

Comments
 (0)