Material-ui: You have provided an out-of-range value `Insegnante` for the select (name="professione") component.

Created on 22 Nov 2019  路  4Comments  路  Source: mui-org/material-ui

Hi I'm working with material-ui version 4.6.1 and I've a problem using a select.

The complete error is:

Material-UI: you have provided an out-of-range value Teacher for the select (name="work") component.
Consider providing a value that matches one of the available options or ''.
The available values are There are no valid options

The line that generates this error is the following

{/* SELECT */} <Select onChange={handleChange} onBlur={handleBlur} value={values[name]} name={name} disableUnderline={true} disabled={!isEditModeActive} > { Array.isArray(options) && options.length > 0 ? options.map((option: any, index: number) => ( <MenuItem value={option} key={${index}}>{option}</MenuItem> )) : // DEFAULT <MenuItem disabled={true} value={NO_OPTIONS_LABEL}>{NO_OPTIONS_LABEL}</MenuItem> } </Select>

I've writed all as a normal select...can someone help me?

Select incomplete

Most helpful comment

I had the same issue and fixed it with just setting a defaultValue = "" in my component

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anthony-dandrea picture anthony-dandrea  路  3Comments

ghost picture ghost  路  3Comments

FranBran picture FranBran  路  3Comments

ghost picture ghost  路  3Comments

revskill10 picture revskill10  路  3Comments