diff --git a/core/css.js b/core/css.js index 716cf0a69..c5f22e8c9 100644 --- a/core/css.js +++ b/core/css.js @@ -547,6 +547,9 @@ Blockly.Css.CONTENT = [ ' outline: none;', ' padding: 4px 0;', ' position: absolute;', + ' overflow-y: auto;', + ' overflow-x: hidden;', + ' max-height: 100%;', ' z-index: 20000;', /* Arbitrary, but some apps depend on it... */ '}', diff --git a/core/field_dropdown.js b/core/field_dropdown.js index a614e944b..d1cc74889 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -174,6 +174,8 @@ Blockly.FieldDropdown.prototype.showEditor_ = function() { Blockly.addClass_(menuDom, 'blocklyDropdownMenu'); // Record menuSize after adding menu. var menuSize = goog.style.getSize(menuDom); + // Recalculate height for the total content, not only box height. + menuSize.height = menuDom.scrollHeight; // Position the menu. // Flip menu vertically if off the bottom. diff --git a/core/widgetdiv.js b/core/widgetdiv.js index ff0b55aac..e1ed474c9 100644 --- a/core/widgetdiv.js +++ b/core/widgetdiv.js @@ -139,4 +139,5 @@ Blockly.WidgetDiv.position = function(anchorX, anchorY, windowSize, } Blockly.WidgetDiv.DIV.style.left = anchorX + 'px'; Blockly.WidgetDiv.DIV.style.top = anchorY + 'px'; + Blockly.WidgetDiv.DIV.style.height = windowSize.height - anchorY + 'px'; };