From 7df21ed14c1ed07642aca9400a8a3efe3b0d6de1 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Fri, 5 Jan 2024 16:32:43 +0100 Subject: [PATCH] Check for scrollbar presence when calculating table widths --- chrome/content/zotero/components/virtualized-table.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chrome/content/zotero/components/virtualized-table.jsx b/chrome/content/zotero/components/virtualized-table.jsx index b639a64a20..d4930720e8 100644 --- a/chrome/content/zotero/components/virtualized-table.jsx +++ b/chrome/content/zotero/components/virtualized-table.jsx @@ -1324,11 +1324,7 @@ class VirtualizedTable extends React.Component { const jsWindow = document.querySelector(`#${this._jsWindowID} .windowed-list`); if (!jsWindow) return; const header = document.querySelector(`#${this.props.id} .virtualized-table-header`); - const scrollbarWidth = Zotero.Utilities.Internal.getScrollbarWidth(); - let paddingWidth = 0; - if (Zotero.isLinux) { - paddingWidth = 2; // from the border - } + const scrollbarWidth = jsWindow.parentElement.getBoundingClientRect().width - jsWindow.parentElement.clientWidth; header.style.setProperty('--scrollbar-width', `${scrollbarWidth}px`); }