diff --git a/superset-frontend/src/components/Select/Select.tsx b/superset-frontend/src/components/Select/Select.tsx index 624571c8e51..fcdbdfc8cda 100644 --- a/superset-frontend/src/components/Select/Select.tsx +++ b/superset-frontend/src/components/Select/Select.tsx @@ -310,10 +310,13 @@ const Select = ({ const handleOnDeselect = (value: string | number | AntdLabeledValue) => { if (Array.isArray(selectValue)) { - const selectedValues = [ - ...(selectValue as []).filter(opt => opt !== value), - ]; - setSelectValue(selectedValues); + if (typeof value === 'number' || typeof value === 'string') { + const array = selectValue as (string | number)[]; + setSelectValue(array.filter(element => element !== value)); + } else { + const array = selectValue as AntdLabeledValue[]; + setSelectValue(array.filter(element => element.value !== value.value)); + } } setSearchedValue(''); };