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

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

Open
Willard21 opened this issue Sep 5, 2020 · 0 comments

Comments

@Willard21
Copy link

Willard21 commented Sep 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant