diff --git a/src/visits/helpers/VisitsFilterDropdown.tsx b/src/visits/helpers/VisitsFilterDropdown.tsx index 3c98bd0e..27936a90 100644 --- a/src/visits/helpers/VisitsFilterDropdown.tsx +++ b/src/visits/helpers/VisitsFilterDropdown.tsx @@ -21,7 +21,7 @@ export const VisitsFilterDropdown = ( const { orphanVisitsType, excludeBots = false } = selected; const propsForOrphanVisitsTypeItem = (type: OrphanVisitType): DropdownItemProps => ({ active: orphanVisitsType === type, - onClick: () => onChange({ ...selected, orphanVisitsType: type }), + onClick: () => onChange({ ...selected, orphanVisitsType: type === selected?.orphanVisitsType ? undefined : type }), }); const onBotsClick = () => onChange({ ...selected, excludeBots: !selected?.excludeBots });