mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 23:28:58 +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 {
|
} else {
|
||||||
[value] = newOptionsData;
|
[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) {
|
if (variableData && variableData?.name && variableData?.id) {
|
||||||
@ -235,8 +242,9 @@ function VariableItem({
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleChange = (value: string | string[]): void => {
|
const handleChange = (inputValue: string | string[]): void => {
|
||||||
// if value is equal to selected value then return
|
const value = variableData.multiSelect && !inputValue ? [] : inputValue;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
value === variableData.selectedValue ||
|
value === variableData.selectedValue ||
|
||||||
(Array.isArray(value) &&
|
(Array.isArray(value) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user