-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dialog] Remove disableEscapeKeyDown
prop, in favor of using the onClose
callback
#27306
Comments
From the pull request that removed
|
Ok sounds good, just wanted to make sure things were remaining consistent |
We will probably need to move this to v6. The reason is that the property still exists in v5, and we wouldn't like to introduce more braking changes now that we are in beta. Thanks for the report @nzayatz14 |
disableEscapeKeyDown
prop, in favor of using the onClose
callback
This is fine for v5. Otherwise the API just looks weird as mentioned in the issue description. I just forgot to do it. |
On the other hand, Modal also does stop event propagation which is a bit scary to change. Let's do this in v6. |
@nzayatz14 Yes. It's similar to the other events but not identical. The motivation to keep it was to kill two birds (not call on click + call |
This is misleading. |
As far as I know, we should close this issue. We don't yet have a case around the problem that we would fix. The concern around API consistency was addressed by highlighting that the props have a different behavior.
@eps1lon Happy to have a longer conversation about it. I guess there are multiple different ways to see this problem.
In #14991, we use the feedback in #13470 (comment) that makes the case for only using This article https://css-tricks.com/dangers-stopping-event-propagation/ makes the case for avoiding stopPropagation unless we absolutely want no other parent event handlers to know about the events. It's why it call stopPropagation in the Autocomplete because it strongly assumes that nobody else should handle the event.
|
Regarding how we manage the product. Up until now, as the owner of it, I have used the milestones to include problems to fix in order to reach a specific larger goal. So I have removed the v6 milestone from this issue because we haven't yet a clear consensus on the direction the product should take on this one. Now, we could act on a different way to manage milestones, by including issues that have been less processed. Meaning we would including potential opportunities, even if half never get into the final shipped outcome. It would be a different tradeoffs. The advantage is that it avoid us to forgot about something, and allows for more exploration, the disadvantage is that we might end up with never ending milestones. With the latter tradeoff, we can use the "discussion" label to signal that we haven't yet dive enough into the problem, and the product owner would have to be conscious about not making the scope of the milestones grow forever, removing issues when needed. |
Hey guys, just wanted to bring up that deprecating those fields makes it kindof impossible out of the box to Since it is not an actual event received in I would love to bring a solution to the problem, but this is over my head 😅 |
I document how I migrated here: https://dev.to/teaganga/handle-dialogdisablebackdropclick-descoped-property-warning-in-mui-v5-2i35 |
Is there any particular reason that the
disableBackdropClick
prop is deprecated on the Dialog component but thedisableEscapeKeyDown
prop is not?I feel like they should either both be deprecated and handled the same way via the
handleClose
function, or neither should be deprecated.Docs (v4.12.1) are currently showing:
The text was updated successfully, but these errors were encountered: