Skip to content

Commit

Permalink
fix: prevent scrollbar visibility recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
WillsterJohnsonAtZenesis committed Nov 19, 2024
1 parent e63bbf4 commit 65c331f
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions source/class/qxl/datagrid/ClippedScrollDataGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ qx.Class.define("qxl.datagrid.ClippedScrollDataGrid", {
},

_updateScrollbarVisibility() {
if (this.__inUpdateScrollbarVisibility) {
return;
}
this.__inUpdateScrollbarVisibility = true;
let scrollX = this.getScrollbarX();
let scrollbarX = this.getChildControl("scrollbar-x");
if (scrollX === "off") {
Expand All @@ -288,15 +292,11 @@ qx.Class.define("qxl.datagrid.ClippedScrollDataGrid", {
scrollbarX.show();
} /* === "auto" */ else {
this.scrollByX(0);

/*
* NOTE: Scrollbar auto does not work, it can create a race condition where it toggles on and off
*/
//if (scrollbarX.getMaximum() > 0) {
scrollbarX.show();
//} else {
// scrollbarX.exclude();
// }
if (scrollbarX.getMaximum() > 0) {
scrollbarX.show();
} else {
scrollbarX.exclude();
}
}

let scrollY = this.getScrollbarY();
Expand All @@ -307,15 +307,13 @@ qx.Class.define("qxl.datagrid.ClippedScrollDataGrid", {
scrollbarY.show();
} /* === "auto" */ else {
this.scrollByY(0);
/*
* NOTE: Scrollbar auto does not work, it can create a race condition where it toggles on and off
*/
//if (scrollbarY.getMaximum() > 0) {
scrollbarY.show();
//} else {
// scrollbarY.exclude();
//}
if (scrollbarY.getMaximum() > 0) {
scrollbarY.show();
} else {
scrollbarY.exclude();
}
}
this.__inUpdateScrollbarVisibility = false;
},

_updateScrollPositions() {
Expand Down

0 comments on commit 65c331f

Please sign in to comment.