fix: fixed all not deselecting and empty array setting to _ALL_ (#6086)

This commit is contained in:
SagarRajput-7 2024-10-16 11:22:30 +05:30 committed by GitHub
parent 0806420dd7
commit 80b3c3e256
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -257,8 +257,7 @@ function VariableItem({
if (variableData.name) {
if (
value === ALL_SELECT_VALUE ||
(Array.isArray(value) && value.includes(ALL_SELECT_VALUE)) ||
(Array.isArray(value) && value.length === 0)
(Array.isArray(value) && value.includes(ALL_SELECT_VALUE))
) {
onValueUpdate(variableData.name, variableData.id, optionsData, true);
} else {
@ -324,10 +323,6 @@ function VariableItem({
Array.isArray(selectedValueStringified) &&
selectedValueStringified.includes(option.toString())
) {
if (newSelectedValue.length === 0) {
handleChange(ALL_SELECT_VALUE);
return;
}
if (newSelectedValue.length === 1) {
handleChange(newSelectedValue[0].toString());
return;