mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: Improve display when selecting variables with the same value (#40607)
* Variables: Allow selection of different variables with the same value * Variables: Don't modify this key
This commit is contained in:
parent
60b4e95d15
commit
e48d77b1eb
@ -138,7 +138,7 @@ const optionsPickerSlice = createSlice({
|
||||
const { multi, selectedValues } = state;
|
||||
|
||||
if (option) {
|
||||
const selected = !selectedValues.find((o) => o.value === option.value);
|
||||
const selected = !selectedValues.find((o) => o.value === option.value && o.text === option.text);
|
||||
|
||||
if (option.value === ALL_VARIABLE_VALUE || !multi || clearOthers) {
|
||||
if (selected || forceSelect) {
|
||||
@ -153,7 +153,7 @@ const optionsPickerSlice = createSlice({
|
||||
return applyStateChanges(state, updateDefaultSelection, updateAllSelection, updateOptions);
|
||||
}
|
||||
|
||||
state.selectedValues = selectedValues.filter((o) => o.value !== option.value);
|
||||
state.selectedValues = selectedValues.filter((o) => o.value !== option.value && o.text !== option.text);
|
||||
} else {
|
||||
state.selectedValues = [];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user