Skip to content

Commit

Permalink
fix(ui): fix DialogContent requires a DialogTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
tszhong0411 committed Jul 26, 2024
1 parent 67d5d58 commit c6530c6
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 c6530c6

Please sign in to comment.