diff --git a/plugins/workspace-backpack/src/backpack.js b/plugins/workspace-backpack/src/backpack.js index 0da0667e55..68b15ba1a0 100644 --- a/plugins/workspace-backpack/src/backpack.js +++ b/plugins/workspace-backpack/src/backpack.js @@ -681,6 +681,12 @@ export class Backpack extends Blockly.DragTarget { } const jsons = this.contents_.map((text) => JSON.parse(text)); this.flyout_.show(jsons); + // TODO: We can remove the setVisible check when updating from ^10.0.0 to + // ^11. + if (this.workspace_.scrollbar && + /** @type {*} */ (this.workspace_.scrollbar).setVisible) { + /** @type {*} */ (this.workspace_.scrollbar).setVisible(false); + } Blockly.Events.fire(new BackpackOpen(true, this.workspace_.id)); } @@ -704,6 +710,12 @@ export class Backpack extends Blockly.DragTarget { return; } this.flyout_.hide(); + // TODO: We can remove the setVisible check when updating from ^10.0.0 to + // ^11. + if (this.workspace_.scrollbar && + /** @type {*} */ (this.workspace_.scrollbar).setVisible) { + /** @type {*} */ (this.workspace_.scrollbar).setVisible(true); + } Blockly.Events.fire(new BackpackOpen(false, this.workspace_.id)); } @@ -942,5 +954,3 @@ class BackpackSerializer { backpack.empty(); } } - -