Skip to content

Commit f5ce3f2

Browse files
committed
fixup! feat(react-dialog): extend backdrop slot to support appearance prop
1 parent 2d44af2 commit f5ce3f2

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

packages/react-components/react-dialog/library/src/components/DialogSurface/DialogSurface.types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ export type DialogSurfaceState = ComponentState<DialogSurfaceSlots> &
6666
Pick<PortalProps, 'mountNode'> & {
6767
open?: boolean;
6868
unmountOnClose?: boolean;
69-
/**
70-
* Whether the backdrop should be rendered as transparent.
71-
*/
7269
backdropTransparent: boolean;
7370

7471
/**

packages/react-components/react-dialog/library/src/components/DialogSurface/useDialogSurface.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ export const useDialogSurface_unstable = (
4141
const modalType = useDialogContext_unstable(ctx => ctx.modalType);
4242
const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);
4343

44-
// Extract appearance from backdrop slot props
45-
const backdropAppearance = isResolvedShorthand(props.backdrop)
46-
? (props.backdrop as DialogBackdropSlotProps).appearance
47-
: undefined;
48-
44+
const backdropAppearance = isResolvedShorthand(props.backdrop) ? props.backdrop.appearance : undefined;
4945
const backdropTransparent = resolveBackdropTransparent(isNestedDialog, backdropAppearance);
5046

5147
const modalAttributes = useDialogContext_unstable(ctx => ctx.modalAttributes);
@@ -93,8 +89,7 @@ export const useDialogSurface_unstable = (
9389

9490
if (backdrop) {
9591
backdrop.onClick = handledBackdropClick;
96-
// Remove custom 'appearance' prop to prevent DOM attribute error
97-
delete (backdrop as DialogBackdropSlotProps).appearance;
92+
delete backdrop.appearance;
9893
}
9994

10095
const { disableBodyScroll, enableBodyScroll } = useDisableBodyScroll();

0 commit comments

Comments
 (0)