From 0bff70b1862b539f557696db13918ecfb8fcacbb Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Wed, 16 Apr 2025 07:53:03 +0200 Subject: [PATCH] Fix item pane blank (#5207) This is caused by the persisted splitter state value to be blank from either older versions of client or plugins. Resetting the empty values fixes this bug. --- chrome/content/zotero/zoteroPane.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index a4b4f0bdb7..f00f00c459 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -6650,6 +6650,12 @@ var ZoteroPane = new function() && Zotero.Prefs.get('reopenPanesOnRestart')) { continue; } + // For some reason, the persisted state of the splitter is empty. This will cause + // the splitter to behave unexpectedly. We set it to 'collapsed' here. + if (["zotero-context-splitter-stacked", "zotero-context-splitter"].includes(el.id) + && attr === 'state' && elValues[attr] === '') { + elValues[attr] = 'collapsed'; + } // Ignore attributes that are no longer persisted for the element if (!allowedAttributes.includes(attr)) { Zotero.debug(`Not restoring '${attr}' for #${id}`);