Skip to content

Commit

Permalink
Merge pull request #2937 from ecency/nt/tags-verify
Browse files Browse the repository at this point in the history
verifying tags on prop update
  • Loading branch information
feruzm authored Oct 28, 2024
2 parents ab7452a + 4782511 commit 58831de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/editorElements/tagInput/view/tagInputView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ const TagInput = ({ value, handleTagChanged, intl, isPreviewActive, autoFocus, s

useEffect(() => {
// read and add tag items
const _tags = typeof value === 'string' ? value.split(' ') : value;
setTags(_tags.filter((t) => !!t));
const _tags = (typeof value === 'string' ? value.split(' ') : value).filter((t) => !!t);
setTags(_tags);
_verifyTagsUpdate(_tags);
}, [value]);

const _verifyTagsUpdate = (tags: string[]) => {
Expand Down

0 comments on commit 58831de

Please sign in to comment.