We have a MultiSelect component already, but it's not really complete. It only lets you select predefined tags from a dropdown. To support use as a tag picker, we should support typing new tags inline and creating them that way (provisionally on the client until submit, which would create them on the server?). Just add an input field inline inside the "input" box and pressing enter adds tags to a list persisted in state. We might not need the dropdown aspect at all, though it's worth thinking about how to hint to the user when the tag they're adding already exists in the system, which might confirm for them that it's the one they actually mean to add to a given resource.
We're currently using Downshift's useMultipleSelection for this, and that's probably sufficient, but consider using React Select (TypeScript rewrite in beta, which is always good). One problem with React Select is bundle size. By my manual testing, adds 24 KB to the minified vendor bundle, while React Select adds 73 KB. 🤦♂️
We have a MultiSelect component already, but it's not really complete. It only lets you select predefined tags from a dropdown. To support use as a tag picker, we should support typing new tags inline and creating them that way (provisionally on the client until submit, which would create them on the server?). Just add an input field inline inside the "input" box and pressing enter adds tags to a list persisted in state. We might not need the dropdown aspect at all, though it's worth thinking about how to hint to the user when the tag they're adding already exists in the system, which might confirm for them that it's the one they actually mean to add to a given resource.
We're currently using Downshift's
useMultipleSelection
for this, and that's probably sufficient, but consider using React Select (TypeScript rewrite in beta, which is always good). One problem with React Select is bundle size. By my manual testing, adds 24 KB to the minified vendor bundle, while React Select adds 73 KB. 🤦♂️