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

how to access editor.onDidContentSizeChange #296

Closed
softmarshmallow opened this issue Oct 9, 2021 · 1 comment
Closed

how to access editor.onDidContentSizeChange #296

softmarshmallow opened this issue Oct 9, 2021 · 1 comment

Comments

@softmarshmallow
Copy link

To make editor height dynamically to the content size, we can follow solution.

microsoft/monaco-editor#794 (comment)

But while using this package, i'm having trouble accessing to onDidContentSizeChange.

const monaco = useMonaco();
  useEffect(() => {
    if (monaco) {
      monaco.editor.onDidContentSizeChange(updateHeight);
    }
  }, [props.src]);


  return (
      <Editor
        loading={<></>} // TODO: add loading state.
        theme="vs-dark"
....
/>
);

Screen Shot 2021-10-09 at 4 34 15 PM

@softmarshmallow
Copy link
Author

Solved.

Solution here: gridaco/assistant@5154b29

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

No branches or pull requests

1 participant