mirror of
https://github.com/google/blockly.git
synced 2026-01-13 20:07:08 +01:00
Fix flyout scrollbar reposition edge case (#4693)
* Fix flyout scrollbar position
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user