From 5cd9cde8ba43548a17d11e5ca711082c522cf821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Romain?= Date: Mon, 19 Feb 2024 09:50:14 +0100 Subject: [PATCH] fix: make checkbox badge with values work again (without fetching the tags all the time) (#5193) * Fix checkbox badge with values not working * Update packages/faceted-search/src/components/Badges/BadgeCheckboxes/BadgeCheckboxes.component.js Co-authored-by: Alexandre Amalric <119614409+aamalric-talend@users.noreply.github.com> --------- Co-authored-by: Alexandre Amalric <119614409+aamalric-talend@users.noreply.github.com> --- .changeset/thin-nails-search.md | 5 +++++ .../Badges/BadgeCheckboxes/BadgeCheckboxes.component.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/thin-nails-search.md diff --git a/.changeset/thin-nails-search.md b/.changeset/thin-nails-search.md new file mode 100644 index 00000000000..51f52c9217d --- /dev/null +++ b/.changeset/thin-nails-search.md @@ -0,0 +1,5 @@ +--- +'@talend/react-faceted-search': patch +--- + +fix: make checkbox badge with values work again (without fetching the tags all the time) diff --git a/packages/faceted-search/src/components/Badges/BadgeCheckboxes/BadgeCheckboxes.component.js b/packages/faceted-search/src/components/Badges/BadgeCheckboxes/BadgeCheckboxes.component.js index 447a2da2e07..0f340b13267 100644 --- a/packages/faceted-search/src/components/Badges/BadgeCheckboxes/BadgeCheckboxes.component.js +++ b/packages/faceted-search/src/components/Badges/BadgeCheckboxes/BadgeCheckboxes.component.js @@ -55,7 +55,7 @@ export const BadgeCheckboxes = ({ const [isLoading, setIsLoading] = useState(true); useEffect(() => { - if (!callbacks || !callbacks.getTags) { + if (values?.length || !callbacks || !callbacks.getTags) { setIsLoading(false); return; }