mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
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:
committed by
David Lechner
parent
c3d4a07053
commit
7509c329d6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user