Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orientation change event bound in inject.js doesn't work for multiple blockly workspaces on one page. #397

Closed
picklesrus opened this issue Jun 3, 2016 · 1 comment · Fixed by #8669
Labels
component: multiworkspace issue: bug Describes why the code or behaviour is wrong low priority

Comments

@picklesrus
Copy link
Contributor

The resize function uses getMainWorkspace which will only resize the most recently touched workspace.
See https://github.com/google/blockly/blob/master/core/inject.js#L325

@rachel-fenichel rachel-fenichel added issue: bug Describes why the code or behaviour is wrong low priority labels Jan 23, 2017
@rachel-fenichel
Copy link
Collaborator

The culprit code is in inject.ts:

    // Some iPad versions don't fire resize after portrait to landscape change.
    if (userAgent.IPAD) {
      browserEvents.conditionalBind(
          window, 'orientationchange', document, function() {
            // TODO (#397): Fix for multiple Blockly workspaces.
            common.svgResize(common.getMainWorkspace() as WorkspaceSvg);
          });
    }

We should check whether this is still necessary for iPads. For other devices this code path isn't hit, and the resize handler in inject.ts is bound separately on each workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: multiworkspace issue: bug Describes why the code or behaviour is wrong low priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants