The resize is triggered when you hit the maximize button or hit it again to restore the window size. The flaw is that, you have to click on the workspace to have it redraw itself. Not sure why this happens.
Now this happens with, injecting resizeable blockly , but does not happen with the following demo apps. They resize perfectly when you hit the maximise button.
Code Editor
https://blockly-demo.appspot.com/static/demos/code/index.html
Blockly Factory
https://blockly-demo.appspot.com/static/demos/blockfactory/index.html
Also some more investigation by running these in Chrome Debugger reveals that this does not happen while the code is run through breakpoints in the onresize() function. All of them resize perfectly.
So the question is what is different about "Code Editor" and "Blockly Factory" that they resize correctly when maximised (without the user having to click on the workspace) while the resizeable blockly does not. Has anyone experience this and found a solution ?
function onresize() { var element = blocklyArea; var x = 0; var y = 0; do { x += element.offsetLeft; y += element.offsetTop; element = element.offsetParent; } while (element); // Position blocklyDiv over blocklyArea. blocklyDiv.style.left = x + 'px'; blocklyDiv.style.top = y + 'px'; blocklyDiv.style.width = blocklyArea.offsetWidth + 'px'; blocklyDiv.style.height = blocklyArea.offsetHeight + 'px'; // Must call this so that the workspace bounds actually get redrawn before next click event Blockly.svgResize(workspace);}