fix(columnWidth): Compensate for scrollbar only if there is vertical scroll

This commit is contained in:
Faris Ansari 2018-08-23 14:22:35 +05:30
parent 7531e13d17
commit a04a5a1d7c
2 changed files with 6 additions and 0 deletions

View File

@ -200,3 +200,7 @@ $.scrollbarWidth = function scrollbarWidth() {
return scrollbarWidth;
};
$.hasVerticalOverflow = function (element) {
return element.scrollHeight > element.offsetHeight + 10;
};

View File

@ -206,6 +206,8 @@ export default class Style {
}
compensateScrollbarWidth() {
if (!$.hasVerticalOverflow(this.bodyScrollable)) return;
requestAnimationFrame(() => {
const scrollbarWidth = $.scrollbarWidth();
const lastCol = this.datamanager.getColumn(-1);