mirror of
https://github.com/zotero/zotero.git
synced 2026-10-01 02:01:24 +00:00
Check for scrollbar presence when calculating table widths
This commit is contained in:
parent
a9eb79a45b
commit
7df21ed14c
1 changed files with 1 additions and 5 deletions
|
|
@ -1324,11 +1324,7 @@ class VirtualizedTable extends React.Component {
|
||||||
const jsWindow = document.querySelector(`#${this._jsWindowID} .windowed-list`);
|
const jsWindow = document.querySelector(`#${this._jsWindowID} .windowed-list`);
|
||||||
if (!jsWindow) return;
|
if (!jsWindow) return;
|
||||||
const header = document.querySelector(`#${this.props.id} .virtualized-table-header`);
|
const header = document.querySelector(`#${this.props.id} .virtualized-table-header`);
|
||||||
const scrollbarWidth = Zotero.Utilities.Internal.getScrollbarWidth();
|
const scrollbarWidth = jsWindow.parentElement.getBoundingClientRect().width - jsWindow.parentElement.clientWidth;
|
||||||
let paddingWidth = 0;
|
|
||||||
if (Zotero.isLinux) {
|
|
||||||
paddingWidth = 2; // from the border
|
|
||||||
}
|
|
||||||
|
|
||||||
header.style.setProperty('--scrollbar-width', `${scrollbarWidth}px`);
|
header.style.setProperty('--scrollbar-width', `${scrollbarWidth}px`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue