Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

366
Views
Material Ui, MUI, Dialog, ScrollTop

I was messing around alot with scrollTop and the Dialog component(A fullscreen fixed modal) from Material-Ui for some time... and I couldn't quite get scrollTop to work. When i click the go down button, It would always give me undefined or it wouldn't work at all in the scrollable container.

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

All that was needed was needed

Make sure the div within the Dialog has overflow

<Dialog fullScreen open={open} onClose={handleClose}>
        <div ref={ref}  
//MOST IMPORTANT
 style={{ backgroundColor: 'red', overflowY: 'auto', height: '100%' }}>

**And an onClick **

<Button
autoFocus
color="inherit"
//HERE
onClick={() => {
const div = ref.current;
div.scrollTop = 800;
}}
>GO DOWN
</Button>

Here's an example https://codesandbox.io/s/fullscreendialog-material-demo-forked-cf8u6?file=/demo.js:2201-2434

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!