diff --git a/frontend/src/components/tagFilter/TagFilter.tsx b/frontend/src/components/tagFilter/TagFilter.tsx index 52e345f08..0d6c638c7 100644 --- a/frontend/src/components/tagFilter/TagFilter.tsx +++ b/frontend/src/components/tagFilter/TagFilter.tsx @@ -56,13 +56,16 @@ const TagFilter: FC = ({ const { exact, query } = data; - const exactResult = exact - ? { - label: exact.name, - value: exact, - sublabel: exact.description ?? "", - } - : undefined; + const exactResult = + exact && + (allowDeleted || !exact.deleted) && + !excludeTags.includes(exact.id) + ? { + label: exact.name, + value: exact, + sublabel: exact.description ?? "", + } + : undefined; const queryResult = query .filter( diff --git a/frontend/src/components/tagSelect/TagSelect.tsx b/frontend/src/components/tagSelect/TagSelect.tsx index 4f764fec4..2fe49fd7d 100644 --- a/frontend/src/components/tagSelect/TagSelect.tsx +++ b/frontend/src/components/tagSelect/TagSelect.tsx @@ -93,13 +93,14 @@ const TagSelect: FC = ({ const { exact, query } = data; - const exactResult = exact - ? { - label: exact.name, - value: exact, - sublabel: exact.description ?? "", - } - : undefined; + const exactResult = + exact && !excluded.includes(exact.id) && (allowDeleted || !exact.deleted) + ? { + label: exact.name, + value: exact, + sublabel: exact.description ?? "", + } + : undefined; const queryResult = query .filter(