Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Incorrect Layout Resizing #4

Closed
JohnDoneth opened this issue Dec 14, 2021 · 3 comments · Fixed by #10
Closed

Incorrect Layout Resizing #4

JohnDoneth opened this issue Dec 14, 2021 · 3 comments · Fixed by #10
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@JohnDoneth
Copy link
Owner

Zooming into the page or resizing the browser window does not re-layout the content as desired; requiring a full page refresh to appear proper.

Examples

image

image

@JohnDoneth JohnDoneth added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Dec 14, 2021
@inoas
Copy link
Contributor

inoas commented Dec 20, 2021

Yes, I noticed.
Related to this is that if you resize the window horizontally it does not rerender and content gets hidden.
On the other hand if you enlarge a window horizontally after load it behaves just fine.
I am not 100% certain but do think this was the case before my PR was merged.

@inoas
Copy link
Contributor

inoas commented Dec 20, 2021

Took a look but cannot figure out now why it did not work:
microsoft/monaco-editor#28

tried this:

const gleamEditor = monaco.editor.create(document.getElementById("gleam-editor"), {
  value: source,
  language: "gleam",
  readOnly: false,
});

const jsEditor = monaco.editor.create(document.getElementById("javascript-editor"), {
  value: "// Click [Build & Run] to see JavaScript output here…",
  language: "javascript",
  readOnly: true,
});

const erlangEditor = monaco.editor.create(document.getElementById("erlang-editor"), {
  value: "// Click [Build] to see Erlang output here…",
  language: "erlang",
  readOnly: true,
});
window.addEventListener(
  "resize",
  function (event) {
    window.requestAnimationFrame(function () {
      console.log("resize layouts");
      gleamEditor.layout();
      jsEditor.layout();
      erlangEditor.layout();
    });
  },
  true
);

... however reflow of layout does nothing still for horizontal shrinking, only for horizontal growing it works.

@Aloso
Copy link
Contributor

Aloso commented Dec 23, 2021

@JohnDoneth I fixed this in PR #10.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants