Skip to content

Commit 5393cb3

Browse files
fix(ui): fix toolbar layout on file load
Signed-off-by: Andy Jakubowski <[email protected]>
1 parent ea98a58 commit 5393cb3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/NotebookPicker.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { ReactWidget } from '@jupyterlab/apputils';
33
import { NotebookPanel } from '@jupyterlab/notebook';
44
import { HTMLSelect } from '@jupyterlab/ui-components';
55
import { deepnoteMetadataSchema } from '../types';
6+
import { Widget } from '@lumino/widgets';
7+
import { Message, MessageLoop } from '@lumino/messaging';
68

79
export class NotebookPicker extends ReactWidget {
810
private selected: string | null = null;
@@ -63,6 +65,13 @@ export class NotebookPicker extends ReactWidget {
6365
this.update();
6466
};
6567

68+
protected onAfterAttach(msg: Message): void {
69+
super.onAfterAttach(msg);
70+
requestAnimationFrame(() => {
71+
MessageLoop.sendMessage(this.parent!, Widget.ResizeMessage.UnknownSize);
72+
});
73+
}
74+
6675
render(): JSX.Element {
6776
const deepnoteMetadata = this.panel.context.model.getMetadata('deepnote');
6877

@@ -81,7 +90,7 @@ export class NotebookPicker extends ReactWidget {
8190
aria-label="Select active notebook"
8291
title="Select active notebook"
8392
style={{
84-
maxWidth: '120px',
93+
width: '120px',
8594
textOverflow: 'ellipsis',
8695
whiteSpace: 'nowrap',
8796
overflow: 'hidden'

0 commit comments

Comments
 (0)