Skip to content

Commit

Permalink
Fix passing invalid props to root
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedShamloo committed Aug 31, 2023
1 parent ad99cf5 commit 5681a28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/mui-base/src/unstable_useModal/useModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ export function useModal(parameters: UseModalParameters): UseModalReturnValue {
): UseModalRootSlotProps<TOther> => {
const propsEventHandlers = extractEventHandlers(parameters) as Partial<UseModalParameters>;

// 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,
Expand Down

0 comments on commit 5681a28

Please sign in to comment.