I have an inputfield/dropdown menu that takes in two JSON objects, symbol and company.
export default function SymbolInput() {
const [data, setData] = useState({ companies: [] });
const classes = useStyles();
useEffect(() => {
Axios.get("https://app.url.io/").then((res) => {
setData({ companies: res.data });
});
}, [setData]);
return (
<div className={classes.root}>
<Autocomplete
multiple
options={data.companies}
getOptionLabel={(option) => option.symbol + ' | ' + option.company}
filterSelectedOptions
renderInput={(params) => (
<TextField
{...params}
variant="outlined"
label="Companies"
/>
)}
/>
</div>
);
How it looks like:
I'd like to keep the dropdown menu as is, and when a user selects or enters a field using the textfield, I want the company symbols only to appear as the placeholder, not symbol + company name.
So as an example, the placeholders for the above image would be A AAPL ABBV ABMD
How may I be able to achieve that?
