diff --git a/ui/component/tagsSearch/view.jsx b/ui/component/tagsSearch/view.jsx index cc4eff86a..cd026f68c 100644 --- a/ui/component/tagsSearch/view.jsx +++ b/ui/component/tagsSearch/view.jsx @@ -30,6 +30,7 @@ type Props = { */ export default function TagsSearch(props: Props) { + const TAG_FOLLOW_MAX = 1000; const { tagsPassedIn = [], unfollowedTags = [], @@ -43,7 +44,7 @@ export default function TagsSearch(props: Props) { placeholder, label, disabled, - limitSelect, + limitSelect = TAG_FOLLOW_MAX, limitShow = 5, } = props; const [newTag, setNewTag] = useState(''); @@ -86,7 +87,14 @@ export default function TagsSearch(props: Props) { setNewTag(''); - const newTagsArr = Array.from(new Set(tags.split(',').map(newTag => newTag.trim().toLowerCase()))); + const newTagsArr = Array.from( + new Set( + tags + .split(',') + .slice(0, limitSelect - countWithoutMature) + .map(newTag => newTag.trim().toLowerCase()) + ) + ); // Split into individual tags, normalize the tags, and remove duplicates with a set. if (onSelect) { @@ -118,10 +126,10 @@ export default function TagsSearch(props: Props) {