From 80b3c3e256b459daf0365a98b410f201468ea7fa Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:22:30 +0530 Subject: [PATCH] fix: fixed all not deselecting and empty array setting to _ALL_ (#6086) --- .../DashboardVariablesSelection/VariableItem.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/frontend/src/container/NewDashboard/DashboardVariablesSelection/VariableItem.tsx b/frontend/src/container/NewDashboard/DashboardVariablesSelection/VariableItem.tsx index a0a444a715..398ade8259 100644 --- a/frontend/src/container/NewDashboard/DashboardVariablesSelection/VariableItem.tsx +++ b/frontend/src/container/NewDashboard/DashboardVariablesSelection/VariableItem.tsx @@ -257,8 +257,7 @@ function VariableItem({ if (variableData.name) { if ( value === ALL_SELECT_VALUE || - (Array.isArray(value) && value.includes(ALL_SELECT_VALUE)) || - (Array.isArray(value) && value.length === 0) + (Array.isArray(value) && value.includes(ALL_SELECT_VALUE)) ) { onValueUpdate(variableData.name, variableData.id, optionsData, true); } else { @@ -324,10 +323,6 @@ function VariableItem({ Array.isArray(selectedValueStringified) && selectedValueStringified.includes(option.toString()) ) { - if (newSelectedValue.length === 0) { - handleChange(ALL_SELECT_VALUE); - return; - } if (newSelectedValue.length === 1) { handleChange(newSelectedValue[0].toString()); return;