Closed hvolschenk closed 18 hours ago
I guess it's simply that the Modal doesn't follow the template, it should be?
diff --git a/packages/mui-material/src/Modal/Modal.js b/packages/mui-material/src/Modal/Modal.js
index 60d29549ff..bbb7839368 100644
--- a/packages/mui-material/src/Modal/Modal.js
+++ b/packages/mui-material/src/Modal/Modal.js
@@ -156,6 +156,7 @@ const Modal = React.forwardRef(function Modal(inProps, ref) {
}
const externalForwardedProps = {
+ ...other,
slots: {
root: components.Root,
backdrop: components.Backdrop,
@@ -218,7 +219,7 @@ const Modal = React.forwardRef(function Modal(inProps, ref) {
* is not meant for humans to interact with directly.
* https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
*/}
- <RootSlot {...rootProps} {...other}>
+ <RootSlot {...rootProps}>
{!hideBackdrop && BackdropComponent ? (
<BackdropSlot {...backdropProps} ref={backdropRef} />
) : null}
@oliviertassinari I would like to work on it.
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
[!NOTE] We value your feedback @hvolschenk! How was your experience with our support team? If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!
Steps to reproduce
Link to live example: codesandbox
Steps:
<Dialog />
.onKeyDown
line.<Dialog />
.Current behavior
When an
onKeyDown
handler is passed to the<Dialog />
component, theEscape
key does not work to close the<Dialog />
anymore.Expected behavior
Just like it used to in
v5
, the<Dialog />
should close when pressingEscape
even when anonKeyDown
is supplied inv6
.Context
No response
Your environment
Check the codesandbox.
Search keywords: dialog, onKeyDown, escape