Closed andresebr closed 4 years ago
@andresebr I can confirm the issue. The component doesn't check the scroll handlers in the drawer. This issue is most visible with the anchor top and bottom, but it's also present with the other anchor variants. I had to solve this very same issue 3 years ago in react-swipeable-views.
This is relatively simple to handle: https://github.com/oliviertassinari/react-swipeable-views/blob/1242299baceea36925cc98deb688d6d2e315f464/packages/react-swipeable-views/src/SwipeableViews.js#L473-L479, in case you want to submit a pull request :).
This issue still persists, even the demo on material-ui.com does not scroll if max-height is set in developer tools for demonstration.
@kamami see #22100
@oliviertassinari Hi! Seem's like an issue still persist on mobile when using SwipeableDrawer anchor="bottom" and anchor="top". I have tested on Android Chrome and iOS Safari and i couldn't scroll a content. Repo i have tested: https://codesandbox.io/s/material-demo-forked-8o4od?file=/demo.js
Android Chrome
@VladSez It was fixed on v5: https://codesandbox.io/s/material-demo-forked-rqfjv?file=/package.json. Please always try the most recent version.
@VladSez It was fixed on v5: https://codesandbox.io/s/material-demo-forked-rqfjv?file=/package.json. Please always try the most recent version.
if overflow is set to visible we cant scroll inside the swpieabledrawer. We cant show the top of the drawer on the screen with a puller if we didn't set overflow to visible. This is frustrating
@VladSez It was fixed on v5: https://codesandbox.io/s/material-demo-forked-rqfjv?file=/package.json. Please always try the most recent version.
Hi! May I know if there will be any fixes applied to v4? I have a project that is currently using v4 and it can be quite a huge change to migrate to v5 just because of this issue
I have a fix working:
I made it a persistent variant and set a couple of the properties conditionally on isOpen or not.. see L54 and L72.
@JeffinJ My workaround was to created a nested div with overflow: auto
or overflow: scroll
so that it wasn't affected by the overflow: visible
on the parent Paper
element. Just make sure to the inner div height: 100%
.
<SwipeableDrawer
anchor='bottom'
swipeAreaWidth={height}
disableSwipeToOpen={false}
ModalProps={{ keepMounted: true }}
PaperProps={{
sx: {
// Since overflow is visible here and not 'auto' or 'scroll', the scrolling needs to happen in a nested div
overflow: 'visible',
height: `calc(90% - 73px)`
}
}}
>
<Box
sx={{
bgcolor: 'white',
position: 'absolute',
top: '-73px',
visibility: 'visible',
right: 0,
left: 0,
height: '73px'
}}
alignItems='center'
>
Foobar
</Box>
<Box height='100%' overflow='auto'>
<MyList />
</Box>
</SwipeableDrawer>
);
Current Behavior 😯
In mobile, scrolling content within a SwipeableDrawer set with
anchor='bottom'
doesn't work at all. This only happens in mobile browsers.Expected Behavior 🤔
Drawer content should be scrollable if the screen height is not big enough, no matter the anchor value.
Steps to Reproduce 🕹
Steps:
theme.breakpoints.down('sm')
(default breakpoint values were not modified).Following the same steps, the issue can also be reproduced with the Swipeable Temporary Drawer -> open bottom example on the demo page.
Context 🔦
Noticed that scrolling content is not an issue when the anchor is set to
'left'
or'right'
.Just in case, here's how I have set up the drawer in my project:
Your Environment 🌎