mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 14:39:00 +08:00
fix: fixed handling of how and when to set ALL option (#7244)
This commit is contained in:
parent
1f33928bf9
commit
e92e0b6e29
@ -157,6 +157,13 @@ function VariableItem({
|
||||
} else {
|
||||
[value] = newOptionsData;
|
||||
}
|
||||
} else if (variableData.multiSelect) {
|
||||
const { selectedValue } = variableData;
|
||||
allSelected =
|
||||
newOptionsData.length > 0 &&
|
||||
Array.isArray(selectedValue) &&
|
||||
selectedValue.length === newOptionsData.length &&
|
||||
newOptionsData.every((option) => selectedValue.includes(option));
|
||||
}
|
||||
|
||||
if (variableData && variableData?.name && variableData?.id) {
|
||||
@ -235,8 +242,9 @@ function VariableItem({
|
||||
},
|
||||
);
|
||||
|
||||
const handleChange = (value: string | string[]): void => {
|
||||
// if value is equal to selected value then return
|
||||
const handleChange = (inputValue: string | string[]): void => {
|
||||
const value = variableData.multiSelect && !inputValue ? [] : inputValue;
|
||||
|
||||
if (
|
||||
value === variableData.selectedValue ||
|
||||
(Array.isArray(value) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user