Render items different from selected in Autocomplete tags #21404
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
status: waiting for author
Issue with insufficient information
It would be nice if
Autocomplete
could show tags different from selected items. Right now there isrenderTags
that has selected items and a function to get tag props from the item's index. This is not a very flexible api because it couples items with their indices.Summary 💡
In our application we built an autocomplete with multi select and items with a tree structure around material-uis
Autocomplete
. The requirement is when you select a parent, its children are automatically selected and disabled in the list, but only the parent shows up in selected tags.I managed to filter out the children from selected items and use them in
renderTags
, but the fact that I had to preserve their indices felt like a hack.So this might as well be a question, is there a better way for this? If no, maybe the api could instead expose
getTagProps
based on some other property than index?Thanks for the help! 🙂
The text was updated successfully, but these errors were encountered: