fix editor scroll bar on first load

It seems that some container of the Editor component is breaking the
resize calculation when the page firsts loads. So we have to be bit
hacky and defer the call the resize until after all components have
been rendered.
This commit is contained in:
David Lechner
2020-06-11 10:06:16 -05:00
committed by David Lechner
parent c3d4a07053
commit 7509c329d6
+3
View File
@@ -49,6 +49,9 @@ class Editor extends React.Component<EditorProps> {
componentDidMount(): void {
window.addEventListener('storage', this.onStorage);
// scroll bar is broken unless we do this when there is an ancestor
// that resizes things during load.
setTimeout(() => this.editorRef.current?.editor.resize(), 0);
}
componentWillUnmount(): void {