From bb98d3209daef338d99258edb1304ca757e5a103 Mon Sep 17 00:00:00 2001 From: kv Date: Wed, 17 Jan 2024 00:12:58 -0800 Subject: [PATCH] clear input when opening tags dropdown --- frontend/src/components/tags/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/components/tags/index.tsx b/frontend/src/components/tags/index.tsx index 233cb8c7f..9bb1a5f06 100644 --- a/frontend/src/components/tags/index.tsx +++ b/frontend/src/components/tags/index.tsx @@ -57,6 +57,10 @@ export const ManageTags = ({ target }: { target: TargetExcludingSystem }) => { if (resource && !tags) setTags(resource.tags); }, [resource, tags]); + useEffect(() => { + if (open) setInput(""); + }, [open]); + const update_tags = (tag: Types.CustomTag) => { const exists = tags?.some((id) => id === tag._id?.$oid); if (exists) return setTags((t) => t?.filter((id) => id !== tag._id?.$oid));