[slider] Breaks with `Modal` + `overflow: "scroll"` on iOS
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Steps to reproduce 🕹
Code:
import * as React from "react";
import {
Modal,
Container,
Slider
} from "@mui/material";
export default function App() {
const marks = [
{
value: 0,
label: "0°C"
},
{
value: 20,
label: "20°C"
},
{
value: 37,
label: "37°C"
},
{
value: 100,
label: "100°C"
}
];
function valuetext(value: number) {
return `${value}°C`;
}
return (
<Modal sx={{ overflow: "scroll" }} open>
<Container
sx={{
minHeight: "200vh",
paddingTop: "20vh",
backgroundColor: "white"
}}
>
<Slider
aria-label="Always visible"
defaultValue={80}
getAriaValueText={valuetext}
step={10}
marks={marks}
valueLabelDisplay="on"
/>
</Container>
</Modal>
);
}
Link to live example:
https://codesandbox.io/s/fervent-mcclintock-xzilxh?file=/src/App.tsx
Steps:
- Using iOS device (Tested on iPad Mini 6 or iPhone 12 Pro)
- Goes to https://xzilxh.csb.app/ (Code Sandbox Live Preview)
- Scroll down to bottom (Till slider disappear from the view port)
- Scroll back up
- Slide on slider
Current behavior 😯
Modal + overflow: "scroll" + Slider on iOS device.
It shows artifact of silder.


Expected behavior 🤔
No artifact, slider behave as it should.
Context 🔦
I'm building review form which allow user to slide and select that perceived intensity of their coffee.
I build this form inside modal and it got too long so I have to add overflow: "scroll" to modal and that is where the problem occurs.

Your environment 🌎
npx @mui/envinfo
System:
OS: Linux 5.10 Debian GNU/Linux 9 (stretch) 9 (stretch)
Binaries:
Node: 14.17.3 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.13 - /usr/local/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
@emotion/react: ^11.4.1 => 11.4.1
@emotion/styled: ^11.3.0 => 11.3.0
@mui/core: 5.0.0-alpha.47
@mui/icons-material: ^5.0.0 => 5.0.0
@mui/material: ^5.0.0 => 5.0.0
@mui/private-theming: 5.0.0
@mui/styled-engine: 5.0.0
@mui/system: ^5.0.0 => 5.0.0
@mui/types: 7.0.0
@mui/utils: 5.0.0
@mui/x-date-pickers: ^5.0.0-alpha.2 => 5.0.0-alpha.2
@types/react: 17.0.15
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
typescript: 4.4.2 => 4.4.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided CodeSandbox example on an iPad Mini 6 or iPhone 12 Pro, using Modal with overflow: "scroll" and the Slider. Inspect the Modal and Slider implementation and their interaction with scrolling, then verify that the slider leaves no artifact after scrolling away and back on iOS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100