diff --git a/core/css.js b/core/css.js index 94a75f723..66a789e9b 100644 --- a/core/css.js +++ b/core/css.js @@ -584,6 +584,7 @@ Blockly.Css.CONTENT = [ '.blocklyContextMenu {', 'border-radius: 4px;', + 'max-height: 100%;', '}', '.blocklyDropdownMenu {', diff --git a/core/widgetdiv.js b/core/widgetdiv.js index 8edad91ff..b51dc5e8d 100644 --- a/core/widgetdiv.js +++ b/core/widgetdiv.js @@ -186,7 +186,12 @@ Blockly.WidgetDiv.positionWithAnchor = function(viewportBBox, anchorBBox, var x = Blockly.WidgetDiv.calculateX_(viewportBBox, anchorBBox, widgetSize, rtl); - Blockly.WidgetDiv.positionInternal_(x, y, widgetSize.height); + if (y < 0) { + Blockly.WidgetDiv.positionInternal_(x, 0, widgetSize.height + y); + } + else { + Blockly.WidgetDiv.positionInternal_(x, y, widgetSize.height); + } }; /**