Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gold-pants-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@radix-ui/react-dialog': minor
---

Prevent customizing id directly in Dialog Description and Title
4 changes: 2 additions & 2 deletions packages/react/dialog/src/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ const TITLE_NAME = 'DialogTitle';

type DialogTitleElement = React.ComponentRef<typeof Primitive.h2>;
type PrimitiveHeading2Props = React.ComponentPropsWithoutRef<typeof Primitive.h2>;
interface DialogTitleProps extends PrimitiveHeading2Props {}
interface DialogTitleProps extends Omit<PrimitiveHeading2Props,"id"> {}

const DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(
(props: ScopedProps<DialogTitleProps>, forwardedRef) => {
Expand All @@ -451,7 +451,7 @@ const DESCRIPTION_NAME = 'DialogDescription';

type DialogDescriptionElement = React.ComponentRef<typeof Primitive.p>;
type PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;
interface DialogDescriptionProps extends PrimitiveParagraphProps {}
interface DialogDescriptionProps extends Omit<PrimitiveParagraphProps,"id"> {}

const DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(
(props: ScopedProps<DialogDescriptionProps>, forwardedRef) => {
Expand Down