For my react project, I am utilizing material-Ui and I am looking to have a placeholder that stands out by having grey text instead of black when compared to the selected item.
<Select
name="answer"
value={values.answer}
onChange={handleChange}
onBlur={handleBlur}
displayEmpty
className={styles.selectEmpty}
>
<MenuItem
value=""
disabled
className={styles.selectPlaceholderText}
>
Answering your Question
</MenuItem>
<MenuItem value={"1"}>1</MenuItem>
<MenuItem value={"2"}>2</MenuItem>
<MenuItem value={"3"}>3</MenuItem>
<MenuItem value={"4"}>4</MenuItem>
</Select>
This method gets me close to what I desire, but there are still some issues:
- The "Answer" placeholder is present as a disabled list item, which I do not want in the list at all.
- Although it initially appears as desired, its color remains black instead of grey even after styling it with
selectPlaceholderText
.