From 478251101ce807f420b9d0124ae9caf3dcbfeb56 Mon Sep 17 00:00:00 2001 From: noumantahir Date: Mon, 28 Oct 2024 20:12:51 +0500 Subject: [PATCH] verifying tags on prop update --- src/components/editorElements/tagInput/view/tagInputView.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/editorElements/tagInput/view/tagInputView.tsx b/src/components/editorElements/tagInput/view/tagInputView.tsx index 18aeab33f8..f37783b9a0 100644 --- a/src/components/editorElements/tagInput/view/tagInputView.tsx +++ b/src/components/editorElements/tagInput/view/tagInputView.tsx @@ -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[]) => {