I'm trying to use Material-UI (MUI) Autocomplete component but more like a search bar. So i am trying to disable the popup of values when you click in the search area/text field. I have tried using the onkeyDown event but this is just keyboard, and i've tried free-solo but it keeps opening the dropdown list. Any ideas chaps?
Sample code ive tried below.
return (
<Autocomplete
openOnFocus={false}
disablePortal={true}
id="combo-box-demo"
freeSolo
options={labels}
sx={{ width: 300 }}
onMouseClick={(event) => {
console.log(event.key);
if (event.key === 'Click') {
// Prevent's default 'Enter' behavior.
event.defaultMuiPrevented = true;
}
}}
renderInput={(params) => <TextField {...params} label="SKU" />}
/>