aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system/src/components/FacetItem.tsx
diff options
context:
space:
mode:
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>2023-06-13 14:09:09 +0200
committersonartech <sonartech@sonarsource.com>2023-06-13 20:03:38 +0000
commit60dd54fcb62f5a475e292c3b8d2a1465c1360399 (patch)
treeedb2d8a8d399d06f74dd92d2621b91921a4ff909 /server/sonar-web/design-system/src/components/FacetItem.tsx
parent3babe1ec01c3219e6c2dafcae1fc8d6985c59fab (diff)
downloadsonarqube-60dd54fcb62f5a475e292c3b8d2a1465c1360399.tar.gz
sonarqube-60dd54fcb62f5a475e292c3b8d2a1465c1360399.zip
SONAR-19345 Allow deselection of now-empty facets
Diffstat (limited to 'server/sonar-web/design-system/src/components/FacetItem.tsx')
-rw-r--r--server/sonar-web/design-system/src/components/FacetItem.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/sonar-web/design-system/src/components/FacetItem.tsx b/server/sonar-web/design-system/src/components/FacetItem.tsx
index 9fbeff5e730..6a4a262d417 100644
--- a/server/sonar-web/design-system/src/components/FacetItem.tsx
+++ b/server/sonar-web/design-system/src/components/FacetItem.tsx
@@ -47,7 +47,9 @@ export function FacetItem({
tooltip,
value,
}: FacetItemProps) {
- const disabled = disabledProp || (stat !== undefined && stat === 0);
+ // alow an active facet to be disabled even if it now has a "0" stat
+ // (it was activated when a different value of My issues/All/New code was selected)
+ const disabled = disabledProp || (!active && stat !== undefined && stat === 0);
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
event.preventDefault();