Skip to content

Commit e92e0b6

Browse files
fix: fixed handling of how and when to set ALL option (SigNoz#7244)
1 parent 1f33928 commit e92e0b6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

frontend/src/container/NewDashboard/DashboardVariablesSelection/VariableItem.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ function VariableItem({
157157
} else {
158158
[value] = newOptionsData;
159159
}
160+
} else if (variableData.multiSelect) {
161+
const { selectedValue } = variableData;
162+
allSelected =
163+
newOptionsData.length > 0 &&
164+
Array.isArray(selectedValue) &&
165+
selectedValue.length === newOptionsData.length &&
166+
newOptionsData.every((option) => selectedValue.includes(option));
160167
}
161168

162169
if (variableData && variableData?.name && variableData?.id) {
@@ -235,8 +242,9 @@ function VariableItem({
235242
},
236243
);
237244

238-
const handleChange = (value: string | string[]): void => {
239-
// if value is equal to selected value then return
245+
const handleChange = (inputValue: string | string[]): void => {
246+
const value = variableData.multiSelect && !inputValue ? [] : inputValue;
247+
240248
if (
241249
value === variableData.selectedValue ||
242250
(Array.isArray(value) &&

0 commit comments

Comments
 (0)