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:
@@ -138,7 +138,7 @@ const optionsPickerSlice = createSlice({
|
|||||||
const { multi, selectedValues } = state;
|
const { multi, selectedValues } = state;
|
||||||
|
|
||||||
if (option) {
|
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 (option.value === ALL_VARIABLE_VALUE || !multi || clearOthers) {
|
||||||
if (selected || forceSelect) {
|
if (selected || forceSelect) {
|
||||||
@@ -153,7 +153,7 @@ const optionsPickerSlice = createSlice({
|
|||||||
return applyStateChanges(state, updateDefaultSelection, updateAllSelection, updateOptions);
|
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 {
|
} else {
|
||||||
state.selectedValues = [];
|
state.selectedValues = [];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user