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

301
Visualizações
MUI Select - change icon background color when on hover

I am currently working to customize MUI Select method, However, I found it is difficult to hover the "NarrowDownIcon":

enter image description here

I want to change the backgroundColor of this icon to "blue" when hover it, this is my code:

icon: {
  color:        theme.palette.primary.dark,
  height:       32,
  width:        32,
  top:          `calc(50% - ${theme.spacing(2.2)}px)`,
  borderRadius: "50%",
  cursor:       "pointer",

  "&:hover": {
    backgroundColor: theme.palette.primary.lighter,
  },
},

then i applied this css to select icon class:

  <Select
      value={selectedValue}
      onChange={onChange}
      onFocus={onFocus}
      onBlur={onBlur}
      className={classes.textInput}
      inputProps={{
        id,
        name: id,
      }}
      classes={{
        icon: classes.icon,
      }}

but it doesn't work , can anyone help me with this, Thank you

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

0

To change the icon color when you hover anywhere inside Select:

root: {
  "&:hover .MuiSvgIcon-root": {
    color: "red"
  }
},
<Select className={classes.root}>

To change the icon color when you only hover on the icon itself (not the input field). Note that your code doesn't work because the icon has pointerEvents set to none:

icon: {
  pointerEvents: "auto",
  "&:hover": {
    color: "red"
  }
}
<Select classes={{ icon: classes.icon }}>

Codesandbox Demo

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