I'm completely new to using MUI and React, and I've run into an issue with changing the text color in my input field. Even though I specified
inputProps={{sx: { color: "CCCCCC" }}}
, the text color remains black while the label and search icon colors change as expected. How can I resolve this problem? Here is the code for my React component:
return (
<div className="navbar">
<form onSubmit={requestData}>
<TextField
fullWidth
id="fullWidth"
label="Enter a fragrance name!"
InputLabelProps={{ sx: { color: "#CCCCCC" }}}
inputProps={{sx: { color: "CCCCCC" }}}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<IconButton onClick={requestData}>
<SearchIcon sx={{color: "#CCCCCC"}}/>
</IconButton>
</InputAdornment>)
}}
onChange={(e) => setSearch(e.target.value)}
/>
</form>
</div>
)