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

196
Views
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 answers
Answer question

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 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!