diff --git a/core/flyout_base.js b/core/flyout_base.js index 280d2eaba..4aca6b9f2 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -441,6 +441,17 @@ Blockly.Flyout.prototype.positionAt_ = function(width, height, x, y) { // Set the scrollbars origin to be the top left of the flyout. scrollbar.setOrigin(x, y); scrollbar.resize(); + // If origin changed and metrics haven't changed enough to trigger + // reposition in resize, we need to call setPosition. See issue #4692. + if (scrollbar.hScroll) { + scrollbar.hScroll.setPosition( + scrollbar.hScroll.position.x, scrollbar.hScroll.position.y); + } + if (scrollbar.vScroll) { + scrollbar.vScroll.setPosition( + scrollbar.vScroll.position.x, scrollbar.vScroll.position.y); + + } } };