[SwipeableDrawer] hideBackDrop raise TypeError #25168
Comments
|
@tuy3t-tran Interesting. We have worked on this problem 3 years ago in #12969. The first thing I could notice is that the I would propose the following fix: diff --git a/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js b/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js
index 5cb059a702..87528f7b01 100644
--- a/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js
+++ b/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js
@@ -445,7 +445,7 @@ const SwipeableDrawer = React.forwardRef(function SwipeableDrawer(inProps, ref)
// At least one element clogs the drawer interaction zone.
if (
open &&
- !backdropRef.current.contains(nativeEvent.target) &&
+ (hideBackdrop || !backdropRef.current.contains(nativeEvent.target)) &&
!paperRef.current.contains(nativeEvent.target)
) {
return;
@@ -552,6 +552,7 @@ const SwipeableDrawer = React.forwardRef(function SwipeableDrawer(inProps, ref)
},
...ModalPropsProp,
}}
+ hideBackdrop={hideBackdrop}
PaperProps={{
...PaperProps,
style: {What do you think about it? Do you want to work on a pull request? :) |
|
Hi, thank you for your reply! I applied your suggestion in my local env, and problem seem fixed. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Current Behavior馃槸
Using SwipeableDrawer with following props:
There will be this error raising at some point:
Expected Behavior馃
There should be no error.
The text was updated successfully, but these errors were encountered: