Skip to content

Commit

Permalink
fixed when incresing width of notebook
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
  • Loading branch information
jonah-iden committed Apr 30, 2024
1 parent 16279ca commit d46a179
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/notebook/src/browser/view/notebook-main-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ export class NotebookMainToolbar extends React.Component<NotebookMainToolbarProp
if (this.gapElement && this.gapElement.getBoundingClientRect().width < NotebookMainToolbar.MIN_FREE_AREA && this.state.numberOfHiddenItems < numberOfMenuItems) {
this.setState({ ...this.state, numberOfHiddenItems: this.state.numberOfHiddenItems + 1 });
this.lastGapElementWidth = this.gapElement.getBoundingClientRect().width;
} else if (this.gapElement && this.gapElement.getBoundingClientRect().width > this.lastGapElementWidth) {
this.setState({ ...this.state, numberOfHiddenItems: this.state.numberOfHiddenItems <= 1 ? 0 : this.state.numberOfHiddenItems - 1 });
} else if (this.gapElement && this.gapElement.getBoundingClientRect().width > this.lastGapElementWidth && this.state.numberOfHiddenItems > 0) {
this.setState({ ...this.state, numberOfHiddenItems: 0 });
this.lastGapElementWidth = this.gapElement.getBoundingClientRect().width;
}
}
Expand Down

0 comments on commit d46a179

Please sign in to comment.