Skip to content

Commit

Permalink
fix: fixed deselecting all options
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarRajput-7 committed Jun 13, 2024
1 parent 34688bc commit 9a96c27
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import dashboardVariablesQuery from 'api/dashboard/variables/dashboardVariablesQ
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { commaValuesParser } from 'lib/dashbaordVariables/customCommaValuesParser';
import sortValues from 'lib/dashbaordVariables/sortVariableValues';
import { debounce, isArray, isEmpty, isString } from 'lodash-es';
import { debounce, isArray, isString } from 'lodash-es';
import map from 'lodash-es/map';
import { ChangeEvent, memo, useEffect, useMemo, useState } from 'react';
import { useQuery } from 'react-query';
Expand Down Expand Up @@ -213,9 +213,7 @@ function VariableItem({

const handleChange = (value: string | string[]): void => {
if (variableData.name) {
if (isEmpty(value)) {
onValueUpdate(variableData.name, variableData.id, value, false);
} else if (
if (
value === ALL_SELECT_VALUE ||
(Array.isArray(value) && value.includes(ALL_SELECT_VALUE)) ||
(Array.isArray(value) && value.length === 0)
Expand Down

0 comments on commit 9a96c27

Please sign in to comment.