Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

270
Visualizações
React - Enable background scrolling when Material UI Dialog is open

I've got a component that opens and closes a Material UI Dialog. At the moment, there is text that is displayed on the page followed by a button that simply opens the dialog. I've created a code sandbox to highlight where I am with this: https://codesandbox.io/s/formdialog-material-demo-forked-cgjgh?file=/demo.js:0-8775

When the dialog is open, is it possible to enable scrolling in the background (i.e. on the main page) so that the user can scroll through the text as an example? I've included the hideBackdrop prop to be true so that the backdrop is hidden, but I'm not sure how to to do it so the scrolling on the main page can be enabled.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Please disable overflow:hidden style property of body tag when opening dialog.

about 4 years ago · Juan Pablo Isaza Relatório

0

For me setting "disableScrollLock" property to true solved the problem. I found it under Material UI Modal documentation: https://mui.com/material-ui/api/modal/

<Dialog open={open} 
        onClose={handleClose} 
        hideBackdrop={true}
        disableScrollLock
  >

I tested it in your CodeSandbox example and it worked as it was supposed to. Hope this helps with your problem!

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda