diff --git a/frontend/app/components/shared/Filters/FilterOperator/FilterOperator.tsx b/frontend/app/components/shared/Filters/FilterOperator/FilterOperator.tsx index 137891866..c10dd9396 100644 --- a/frontend/app/components/shared/Filters/FilterOperator/FilterOperator.tsx +++ b/frontend/app/components/shared/Filters/FilterOperator/FilterOperator.tsx @@ -61,7 +61,7 @@ const dropdownStyles = { } } interface Props { - onChange: (e, { name, value }) => void; + onChange: (e: any, { name, value }: any) => void; className?: string; options?: any; value?: string; @@ -78,7 +78,7 @@ function FilterOperator(props: Props) { styles={dropdownStyles} placeholder="Select" isDisabled={isDisabled} - defaultValue={ value } + value={value ? options.find((i: any) => i.value === value) : null} onChange={({ value }: any) => onChange(null, { name: 'operator', value })} /> diff --git a/frontend/app/types/filter/newFilter.js b/frontend/app/types/filter/newFilter.js index ba537484c..05c1fdf0e 100644 --- a/frontend/app/types/filter/newFilter.js +++ b/frontend/app/types/filter/newFilter.js @@ -6,7 +6,6 @@ import { capitalize } from 'App/utils'; const countryOptions = Object.keys(countries).map(i => ({ label: countries[i], value: i })); const containsFilters = [{ key: 'contains', label: 'contains', text: 'contains', value: 'contains' }] -// export const metaFilter = { key: FilterKey.METADATA, type: FilterType.MULTIPLE, category: FilterCategory.METADATA, label: 'Metadata', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/metadata' }; export const filters = [ { key: FilterKey.CLICK, type: FilterType.MULTIPLE, category: FilterCategory.INTERACTIONS, label: 'Click', operator: 'on', operatorOptions: filterOptions.targetOperators, icon: 'filters/click', isEvent: true }, { key: FilterKey.INPUT, type: FilterType.MULTIPLE, category: FilterCategory.INTERACTIONS, label: 'Input', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/input', isEvent: true },