diff --git a/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx b/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx index ba0afd898e..f3e00c32c1 100644 --- a/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx +++ b/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx @@ -623,11 +623,12 @@ export class EntitySelector extends React.Component<{ const { partitionedSearchResults } = this if (this.searchInput) { const { selected = [] } = partitionedSearchResults ?? {} - this.selectionArray.deselectEntities( - selected.map((entity) => entity.name) - ) + const entityNames = selected.map((entity) => entity.name) + this.selectionArray.deselectEntities(entityNames) + this.manager.focusArray?.deactivate(...entityNames) } else { this.selectionArray.clearSelection() + this.manager.focusArray?.clear() } }