-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
The table scrolling is not always activated, even when tabel content is partially hidden.
Proposed fix
// Line 201 - vscode-table.js
_resizeTableBody() {
let headerHeight = 0;
let tbodyHeight = 0;
const tableHeight = this.getBoundingClientRect().height;
if (this._assignedHeaderElements && this._assignedHeaderElements.length) {
headerHeight =
this._assignedHeaderElements[0].getBoundingClientRect().height;
}
if (this._assignedBodyElements && this._assignedBodyElements.length) {
// Fix: scrollHeight gives natural content size vs constrained getBoundingClientRect
tbodyHeight = this._assignedBodyElements[0].scrollHeight;
}
const availableContentHeight = Math.max(0, tableHeight - headerHeight);
// Fix: was tbodyHeight - headerHeight - tableHeight > 0 (problem calculation)
const needsScrolling = tbodyHeight > availableContentHeight;
this._scrollableElement.style.height =
needsScrolling ? `${availableContentHeight}px` : 'auto';
}
Metadata
Metadata
Assignees
Labels
No labels