Skip to content

Resizing a webpage's width sets it to 400px tall regardless of starting height #738

@Willard21

Description

@Willard21

When a webpage's height is changed through settings or a query string, then drag-resized by the user, the frame snaps down to 400px height and can't be fixed without reloading the page. A bit of debugging narrows down the issue to https://github.com/Khan/live-editor/blob/master/js/live-editor.js#L1405. Since no height is passed to the updateCanvasSize function when it's resized by the user, it uses the default, which is 400.

height = height || this.defaultOutputHeight;

could be changed to

height = height || this.editorHeight || this.defaultOutputHeight;

I tested this with the console after the page loaded and it fixed it.

Edit:
Changing the objects default to whatever it started with when the editor is initialized would be better, since the editor's height is supposed to be able to be dragged, but the canvas's height is meant to be static.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions