This commit is contained in:
seb
2026-10-10 00:48:55 +02:00
parent 4c0691924e
commit f4ad1763f0
12 changed files with 39 additions and 57 deletions

View File

@@ -60,6 +60,10 @@ class AppDialog extends Component {
transitionDuration: _transitionDuration,
TransitionProps: _transitionProps,
TransitionComponent: _transitionComponent,
// Legacy MUI prop (removed in v9) — merge into slotProps.paper instead
// of spreading onto Dialog/DOM where it triggers
// "React does not recognize the `PaperProps` prop" warnings.
PaperProps: legacyPaperProps,
disableScrollLock = true,
slotProps: userSlotProps,
slots: userSlots,
@@ -69,6 +73,18 @@ class AppDialog extends Component {
void _transitionProps;
void _transitionComponent;
const userPaper = userSlotProps?.paper ?? {};
const { sx: userPaperSx, ...restPaper } = userPaper;
const { sx: legacyPaperSx, ...restLegacyPaper } = legacyPaperProps ?? {};
const toSxArray = (sx) =>
// eslint-disable-next-line no-nested-ternary
Array.isArray(sx) ? sx : sx ? [sx] : [];
const mergedPaperSx = [...toSxArray(legacyPaperSx), ...toSxArray(userPaperSx)];
const mergedPaper =
mergedPaperSx.length > 0
? { ...restLegacyPaper, ...restPaper, sx: mergedPaperSx }
: { ...restLegacyPaper, ...restPaper };
const userBackdrop = userSlotProps?.backdrop ?? {};
const { sx: userBackdropSx, ...restBackdrop } = userBackdrop;
const userTransition = userSlotProps?.transition ?? {};
@@ -77,6 +93,7 @@ class AppDialog extends Component {
const slotProps = {
...userSlotProps,
paper: mergedPaper,
backdrop: {
...restBackdrop,
sx: [