You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/api-docs/dialog.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ The `MuiDialog` name can be used for providing [default props](/customization/gl
32
32
| <spanclass="prop-name">aria-labelledby</span> | <spanclass="prop-type">string</span> || The id(s) of the element(s) that label the dialog. |
33
33
| <spanclass="prop-name">children</span> | <spanclass="prop-type">node</span> || Dialog children, usually the included sub-components. |
34
34
| <spanclass="prop-name">classes</span> | <spanclass="prop-type">object</span> || Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
35
-
| <spanclass="prop-name">disableBackdropClick</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, clicking the backdrop will not fire the `onClose` callback. |
36
35
| <spanclass="prop-name">disableEscapeKeyDown</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, hitting escape will not fire the `onClose` callback. |
37
36
| <spanclass="prop-name">fullScreen</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, the dialog is full-screen. |
38
37
| <spanclass="prop-name">fullWidth</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, the dialog stretches to `maxWidth`.<br>Notice that the dialog width grow is limited by the default margin. |
Copy file name to clipboardExpand all lines: docs/pages/api-docs/modal.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,6 @@ This component shares many concepts with [react-overlays](https://react-bootstra
42
42
| <spanclass="prop-name">closeAfterTransition</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | When set to true the Modal waits until a nested Transition is completed before closing. |
43
43
| <spanclass="prop-name">container</span> | <spanclass="prop-type">HTML element<br>| func</span> || A HTML element or function that returns one. The `container` will have the portal children appended to it.<br>By default, it uses the body of the top-level document object, so it's simply `document.body` most of the time. |
44
44
| <spanclass="prop-name">disableAutoFocus</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, the modal will not automatically shift focus to itself when it opens, and replace it to the last focused element when it closes. This also works correctly with any modal children that have the `disableAutoFocus` prop.<br>Generally this should never be set to `true` as it makes the modal less accessible to assistive technologies, like screen readers. |
45
-
| <spanclass="prop-name">disableBackdropClick</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, clicking the backdrop will not fire `onClose`. |
46
45
| <spanclass="prop-name">disableEnforceFocus</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, the modal will not prevent focus from leaving the modal while open.<br>Generally this should never be set to `true` as it makes the modal less accessible to assistive technologies, like screen readers. |
47
46
| <spanclass="prop-name">disableEscapeKeyDown</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | If `true`, hitting escape will not fire `onClose`. |
48
47
| <spanclass="prop-name">disablePortal</span> | <spanclass="prop-type">bool</span> | <spanclass="prop-default">false</span> | The `children` will be inside the DOM hierarchy of the parent component. |
- Remove the `disableBackdropClick` prop because redundant.
608
+
Ignore close events from `onClose` when `reason === 'backdropClick'` instead.
609
+
610
+
```diff
611
+
<Modal
612
+
- disableBackdropClick
613
+
- onClose={handleClose}
614
+
+ onClose={(event, reason) => {
615
+
+ if (reason !== 'backdropClick') {
616
+
+ onClose(event, reason);
617
+
+ }
618
+
+ }}
619
+
/>
620
+
```
621
+
622
+
- Remove the `onEscapeKeyDown` prop because redundant.
623
+
Use `onClose` with `reason === "escapeKeyDown"` instead.
624
+
625
+
```diff
626
+
<Modal
627
+
- onEscapeKeyDown={handleEscapeKeyDown}
628
+
+ onClose={(event, reason) => {
629
+
+ if (reason === 'escapeKeyDown') {
630
+
+ handleEscapeKeyDown(event);
631
+
+ }
632
+
+ }}
633
+
/>
634
+
```
635
+
592
636
- Remove `onRendered` prop.
593
637
Depending on your use case either use a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) on the child element or an effect hook in the child component.
0 commit comments