fixed tag suggestion bug

This commit is contained in:
Pranab Singh 2019-10-09 02:28:07 +05:30 committed by Sean Yesmunt
parent 8c4c5709c6
commit 4eb216e52c

View file

@ -35,9 +35,7 @@ export default function TagsSearch(props: Props) {
}
const doesTagMatch = name => {
let nextTag;
nextTag = newTag.substr(newTag.lastIndexOf(',') + 1, newTag.length);
nextTag = newTag.substr(newTag.lastIndexOf(' ') + 1, newTag.length);
const nextTag = newTag.substr(newTag.lastIndexOf(',') + 1, newTag.length).trim();
return newTag ? name.toLowerCase().includes(nextTag.toLowerCase()) : true;
};
// Make sure there are no duplicates, then trim