Skip to content

Commit 0744e75

Browse files
authored
fix: Chromium patch to avoid showing scrollbar too early (#1978)
1 parent 32da143 commit 0744e75

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/common/src/services/resizer.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ export class ResizerService {
404404
this.resizeColumnsByCellContent(false);
405405
}
406406

407+
// patch for Chromium browsers to avoid scrollbar from showing way too early when using `overflow:auto`
408+
// the canvas size equals exactly the size of its container and for some users (not all) it will show the horizontal scrollbar too early.
409+
// not exactly sure but, this might be caused by a floating precision on some computers
410+
this._gridDomElm.style.width = typeof newWidth === 'string' ? newWidth : `${(newWidth || 1) + 0.2}px`;
411+
407412
// keep last resized dimensions & resolve them to the Promise
408413
this._lastDimensions = {
409414
height: newHeight || 0,

0 commit comments

Comments
 (0)