[material-ui][Autocomplete] freeSolo type search not allowed to change/edit the clearIcon #42995
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
package: material-ui
Specific to @mui/material
support: Stack Overflow
Please ask the community on Stack Overflow
Steps to reproduce
Link to live example: (required)
There is no specific steps, I have copied code from docs, from https://mui.com/material-ui/react-autocomplete/#free-solo
Steps:
https://mui.com/material-ui/api/autocomplete/#autocomplete-prop-clearIcon
`
import Autocomplete from '@mui/material/Autocomplete';
import DeleteIcon from '@mui/icons-material/Delete';
<Autocomplete
freeSolo
id="free-solo-2-demo"
disableClearable
options={top100Films.map((option) => option.title)}
clearIcon={<DeleteIcon></DeleteIcon>}
renderInput={(params) => (
<TextField
{...params}
label="Search input"
InputProps={{
...params.InputProps,
type: 'search',
}}
/>
)}
/>`
Current behavior
Expected behavior
I would like to replace existing default clearIcon with my own SVG Ion
Context
No response
Your environment
"use client";
import * as React from "react";
import TextField from "@mui/material/TextField";
import Stack from "@mui/material/Stack";
import Autocomplete from "@mui/material/Autocomplete";
import DeleteIcon from "@mui/icons-material/Delete";
export default function FreeSolo() {
return (
<Stack spacing={2} sx={{ width: 300 }}>
<Autocomplete
freeSolo
id="free-solo-2-demo"
disableClearable
options={top100Films.map((option) => option.title)}
clearIcon={}
renderInput={(params) => (
<TextField
{...params}
label="Search input"
InputProps={{
...params.InputProps,
type: "search",
}}
/>
)}
/>
);
}
Search keywords: Autocomplete freeSolo type search
The text was updated successfully, but these errors were encountered: