Skip to content

Commit 4db738f

Browse files
authored
Merge pull request #231 from traggo/fix-tag-value-filtering
Fix tag value filtering
2 parents 14cb142 + b7f2619 commit 4db738f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/src/tag/suggest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ export const useSuggest = (
2121
const valueResult = useQuery<SuggestTagValue, SuggestTagValueVariables>(gqlTags.SuggestTagValue, {
2222
variables: {tag: tagKey, query: tagValue},
2323
skip: exactMatch === undefined || skipValue,
24+
fetchPolicy: 'no-cache',
2425
});
2526

2627
const usedKeys = usedTags.map((t) => t.tag.key);
27-
const usedValues = usedTags.map((t) => t.value);
2828

2929
if (exactMatch && tagValue !== undefined && !skipValue && (allowDuplicateKeys || usedKeys.indexOf(exactMatch.key) === -1)) {
30+
const usedValues = usedTags.filter((t) => t.tag.key === tagKey).map((t) => t.value);
3031
return suggestTagValue(exactMatch, tagValue, valueResult, usedValues, createTags);
3132
} else {
3233
return suggestTag(exactMatch, tagResult, tagKey, usedKeys, allowDuplicateKeys, createTags);

0 commit comments

Comments
 (0)