From f53c5dd82d7776379e7a42118fe248e330de2a18 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Tue, 10 Dec 2024 17:19:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20dismiss=20focused=20entities=20w?= =?UTF-8?q?hen=20selection=20is=20cleared?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/entitySelector/EntitySelector.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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() } }