From 1ab1d34a88ea73bfddb6d5e8a95ab7c6c3c0d169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 24 Sep 2025 11:14:28 +0300 Subject: [PATCH] Fix switching to different citation explorer view not resetting selection --- .../content/zotero/integration/citationExplorer.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/integration/citationExplorer.js b/chrome/content/zotero/integration/citationExplorer.js index 83c2007987..14ae0dd62b 100644 --- a/chrome/content/zotero/integration/citationExplorer.js +++ b/chrome/content/zotero/integration/citationExplorer.js @@ -166,10 +166,8 @@ window.ZoteroDocumentCitations = { onSelectionChange={this.onCitationSelectionChange.bind(this)} getRowString={index => this._renderedCitationRows[index].title} />); - domElem.addEventListener("focusout", (event) => { - if (event.relatedTarget && !event.relatedTarget.closest("#citation-list-container")) { - citationList?.selection.clearSelection() - } + domElem.addEventListener("focusin", (event) => { + itemList?.selection.clearSelection() }); }); } @@ -196,10 +194,8 @@ window.ZoteroDocumentCitations = { firstColumnExtraWidth: 28-16, }); await itemList.waitForLoad(); - domElem.addEventListener("focusout", (event) => { - if (event.relatedTarget && !event.relatedTarget.closest("#item-list-container")) { - itemList?.selection.clearSelection() - } + domElem.addEventListener("focusin", (event) => { + citationList?.selection.clearSelection() }); } await itemList.changeCollectionTreeRow({