diff --git a/chrome/content/zotero/integration/citationDialog.js b/chrome/content/zotero/integration/citationDialog.js index 7f6c09d9bd..c1755d4f7f 100644 --- a/chrome/content/zotero/integration/citationDialog.js +++ b/chrome/content/zotero/integration/citationDialog.js @@ -878,6 +878,13 @@ class ListLayout extends Layout { // set min height and resize the window let autoHeight = bubbleInputHeight + sectionsHeight + sectionsWrapperPadding + bottomHeight + marginOfError; + // window.resizeTo(X,Y) resizes the window so that it's outerHeight == Y. On mac and windows, + // innerHeight and outerHeight are the same. On linux, the outerHeight > innerHeight, perhaps + // outerHeight there includes chrome, borders, etc. This difference is accounted for below, so that the dialog + // itself (not the outer window) ends up with the desired height. + if (Zotero.isLinux) { + autoHeight += (window.outerHeight - window.innerHeight); + } let minHeight = bubbleInputHeight + bottomHeight; doc.documentElement.style.minHeight = `${minHeight}px`; diff --git a/test/tests/citationDialogTest.js b/test/tests/citationDialogTest.js index 110c6d7046..8dae8c2dca 100644 --- a/test/tests/citationDialogTest.js +++ b/test/tests/citationDialogTest.js @@ -415,6 +415,10 @@ describe("Citation Dialog", function () { it("should perform search in list mode", async function () { IOManager.toggleDialogMode("list"); + // Wait for search triggered after switching dialog modes to finish + while (SearchHandler.searching) { + await Zotero.Promise.delay(10); + } // Search for "one" await dialog.currentLayout.search("one", { skipDebounce: true }); // Selected items should have both "one_selected" and "one_selected_open" @@ -442,6 +446,10 @@ describe("Citation Dialog", function () { it("should perform search in library mode", async function () { IOManager.toggleDialogMode("library"); + // Wait for search triggered after switching dialog modes to finish + while (SearchHandler.searching) { + await Zotero.Promise.delay(10); + } // Search for "one" await dialog.currentLayout.search("one", { skipDebounce: true }); // Selected items should have both "one_selected" and "one_selected_open"