Skip to content

Commit

Permalink
fix: Backpack plugin inverted scrollbars in position method (#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarades authored Aug 10, 2023
1 parent e7c7d0d commit 3e90e61
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions plugins/workspace-backpack/src/backpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,12 @@ export class Backpack extends Blockly.DragTarget {
if (!this.initialized_) {
return;
}
const hasVerticalScrollbars = this.workspace_.scrollbar &&
this.workspace_.scrollbar.canScrollHorizontally();
const hasHorizontalScrollbars = this.workspace_.scrollbar &&
this.workspace_.scrollbar.canScrollVertically();

const scrollbars = this.workspace_.scrollbar;
const hasVerticalScrollbars = scrollbars &&
scrollbars.isVisible() && scrollbars.canScrollVertically();
const hasHorizontalScrollbars = scrollbars &&
scrollbars.isVisible() && scrollbars.canScrollHorizontally();

if (metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_LEFT ||
(this.workspace_.horizontalLayout && !this.workspace_.RTL)) {
Expand Down Expand Up @@ -431,7 +433,7 @@ export class Backpack extends Blockly.DragTarget {
}

this.svgGroup_.setAttribute('transform',
'translate(' + this.left_ + ',' + this.top_ + ')');
`translate(${this.left_},${this.top_})`);
}

/**
Expand Down

0 comments on commit 3e90e61

Please sign in to comment.