Skip to content

Commit

Permalink
Merge pull request #812 from tszhong0411/pack-3-dialogcontent-require…
Browse files Browse the repository at this point in the history
…s-a-dialogtitle

fix(ui): fix DialogContent requires a DialogTitle
  • Loading branch information
tszhong0411 committed Jul 26, 2024
2 parents 67d5d58 + c6530c6 commit 63e8688
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brown-mugs-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tszhong0411/ui': patch
---

fix DialogContent requires a DialogTitle
7 changes: 6 additions & 1 deletion packages/ui/src/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { Command as CommandPrimitive } from 'cmdk'
import { SearchIcon } from 'lucide-react'
import { forwardRef } from 'react'

import { Dialog, DialogContent } from './dialog'
import { Dialog, DialogContent, DialogDescription, DialogTitle } from './dialog'
import { VisuallyHidden } from './visually-hidden'

export const Command = forwardRef<
React.ElementRef<typeof CommandPrimitive>,
Expand Down Expand Up @@ -34,6 +35,10 @@ export const CommandDialog = (props: CommandDialogProps) => {
return (
<Dialog {...rest}>
<DialogContent className='overflow-hidden p-0 shadow-lg'>
<VisuallyHidden>
<DialogTitle>Command Menu</DialogTitle>
<DialogDescription>Search a command</DialogDescription>
</VisuallyHidden>
<Command
className={cn(
'[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium',
Expand Down

0 comments on commit 63e8688

Please sign in to comment.