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

192
Visualizações
Material Ui label breaking in Select component

i have been trying to implement a select component, nothing as I have ever done before, But suddenly my mui-select component is breaking, Below is the image of the bug/issue i am facing

enter image description here

The label of the select element is no longer in sync with the select component itself Here is the code:

                           <FormControl size="small" fullWidth>
                                    <InputLabel id="demo-simple-select-helper">
                                        Marital Status
                                    </InputLabel>
                                    <Select
                                        labelId="demo-simple-select-helper"
                                        id="demo-simple-select-helper"
                                        label="Marital Status"
                                        defaultValue=""
                                        {...getFieldProps('pf.maritalStatus')}
                                    >
                                        <MenuItem value="married">Married</MenuItem>
                                        <MenuItem value="unmarried">Unmarried</MenuItem>
                                        <MenuItem value="widow">Widow</MenuItem>
                                        <MenuItem value="widower">Widower</MenuItem>
                                        <MenuItem value="divorcee">Divorcee</MenuItem>
                                    </Select>
                                </FormControl>

Is there anything wrong i am doing here?

Here is the snippet used in the mui docs

<FormControl fullWidth>
  <InputLabel id="demo-simple-select-label">Age</InputLabel>
  <Select
    labelId="demo-simple-select-label"
    id="demo-simple-select"
    value={age}
    label="Age"
    onChange={handleChange}
  >
    <MenuItem value={10}>Ten</MenuItem>
    <MenuItem value={20}>Twenty</MenuItem>
    <MenuItem value={30}>Thirty</MenuItem>
  </Select>
</FormControl>

Please can anyone tell what's wrong i am doing here?

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

0

const [age,setAge] = React.useState();
function handleChange(e){
   setAge(e.currentTarget.value);
}
return(
   <FormControl fullWidth>
     <InputLabel id="demo-simple-select-label">Age</InputLabel>
      <Select
        labelId="demo-simple-select-label"
        id="demo-simple-select"
        value={age}
        label="Age"
        onChange={handleChange}
      >
        <MenuItem value={10}>Ten</MenuItem>
        <MenuItem value={20}>Twenty</MenuItem>
        <MenuItem value={30}>Thirty</MenuItem>
      </Select>
    </FormControl>
)
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