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

183
Visualizações
How to access material ui Expanded property in Expansion Panel

As shown in the picture below:

The property to be accessed

I needed to make the expansion panel (only the expansion part, when the expansion was active) occupy 100% of the Div it is currently occupying. That height: 100% does the job, but inside my styling, I can't access that property correctly.

My expansion panel code snippet:

<ExpansionPanel classes={{ root: classes.expanded }}

My styling:

expanded: {
  '&$expanded': {
    height: '100%'
  },
  margin: '0 !important',
  boxShadow: 'none',
  borderRadius: 0,
  '&::before': {
    content: 'none'
  }
}

But when rendering my styling it results in the following picture:

enter image description here

It does not apply the styling to the .MuiExpansionPanel-root.Mui-expanded, instead, it is increasing the size of the box when it is not expanded.

Thanks in advance.

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

0

see the MatUI api docs under the css section and the rule names. those are the keys you need to provide to the classes prop. You are setting your expanded class name to the root, you need to set it to expanded

EDIT based on code sandbox

this

  expandedPanel: {
     "&$expanded": {
        height: "100%"
     }
  }

is equivalent to the css

.expandedPanel.expanded{}

However, MatUI is conditionally applying the expandedPanel class already and there is not yet another .expanded class which is why it fails. you dont need to do the &$expanded check yourself. Just need to change it to

  expandedPanel: {
      height: "100%"
  }
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