Material UI and Lab Versions I am using
"@material-ui/core": "^4.8.3",
"@material-ui/lab": "^4.0.0-alpha.44",
My Code
<Autocomplete
multiple
limitTags={2}
id="multiple-limit-tags"
options={Audience}
getOptionLabel={(option: any) => option.title}
renderInput={(params) => (
<TextField {...params} variant="outlined" placeholder="Select collaborator's audience" size="small" />
)}
/>
This attribute is creating issue
limitTags={2}
limitTags
feature is added in - 4.0.0-alpha.47
version
"@material-ui/lab": "^4.0.0-alpha.47",
You should update your npm packages and it should solve your problem.
Working exmaple for autocomplete with limit tags is here - https://codesandbox.io/s/s81k4
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.