From 8d0957a832206e2938b71c9fa1c04b7f2eabaf7c Mon Sep 17 00:00:00 2001 From: saeedShamloo Date: Thu, 31 Aug 2023 22:56:18 +0200 Subject: [PATCH] Fix passing invalid props to root of Dialog --- packages/mui-base/src/unstable_useModal/useModal.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mui-base/src/unstable_useModal/useModal.ts b/packages/mui-base/src/unstable_useModal/useModal.ts index 1845810a01f7b2..4935fcf5f57e15 100644 --- a/packages/mui-base/src/unstable_useModal/useModal.ts +++ b/packages/mui-base/src/unstable_useModal/useModal.ts @@ -166,15 +166,15 @@ export function useModal(parameters: UseModalParameters): UseModalReturnValue { ): UseModalRootSlotProps => { const propsEventHandlers = extractEventHandlers(parameters) as Partial; - // The custom event handlers shouldn't be spread on the root element - delete propsEventHandlers.onTransitionEnter; - delete propsEventHandlers.onTransitionExited; - const externalEventHandlers = { ...propsEventHandlers, ...otherHandlers, }; + // The custom event handlers shouldn't be spread on the root element + delete externalEventHandlers.onTransitionEnter; + delete externalEventHandlers.onTransitionExited; + return { role: 'presentation', ...externalEventHandlers,