Skip to content

Conversation

@eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 18, 2020

Breaking changes

  • [Dialog] Remove the disableBackdropClick prop. It's redundant with the reason argument.

    <Dialog
    - disableBackdropClick
    - onClose={handleClose}
    + onClose={(event, reason) => {
    +   if (reason !== 'backdropClick') {
    +     handleClose(event, reason);
    +   }
    + }}
    />
  • [Modal] Remove the disableBackdropClick prop. It's redundant with the reason argument.

    <Modal
    - disableBackdropClick
    - onClose={handleClose}
    + onClose={(event, reason) => {
    +   if (reason !== 'backdropClick') {
    +     handleClose(event, reason);
    +   }
    + }}
    />

disableEscapeKeyDown is on the chopping block as well but will be handed separately.

Also includes onEscapeKeydown migration guide as a follow-up to #23571

Affected demos:

@eps1lon eps1lon added breaking change Introduces changes that are not backward compatible. scope: dialog Changes related to the dialog. scope: modal Changes related to the modal. labels Nov 18, 2020
@eps1lon eps1lon changed the title Feat/modal/slim down [Dialog,Modal] Remove disableBackdropClick Nov 18, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Nov 18, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 1cff479

Comment on lines -64 to -65
disableBackdropClick
disableEscapeKeyDown
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't have any effect on next either because we already have a fully custom onClose in ConfirmationDialogRaw

@eps1lon eps1lon marked this pull request as ready for review November 19, 2020 09:43
@oliviertassinari oliviertassinari changed the title [Dialog,Modal] Remove disableBackdropClick [Dialog][Modal] Remove disableBackdropClick Nov 19, 2020
@shiraze
Copy link

shiraze commented Aug 15, 2021

Shouldn't the example code still call handleClose(event)?

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 15, 2021

@shiraze Please be specific.

@shiraze
Copy link

shiraze commented Aug 15, 2021

I think initial code examples by @eps1lon should be:

Breaking changes

  • [Dialog] Remove the disableBackdropClick prop. It's redundant with the reason argument.
<Dialog
- disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+   if (reason !== 'backdropClick') {
+     handleClose(event);
+   }
+ }}
/>
  • [Modal] Remove the disableBackdropClick prop. It's redundant with the reason argument.
<Modal
- disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+   if (reason !== 'backdropClick') {
+     handleClose(event);
+   }
+ }}
/>

@oliviertassinari
Copy link
Member

Yes, updated, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. scope: dialog Changes related to the dialog. scope: modal Changes related to the modal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants