Skip to content

Commit

Permalink
Revert change. calculatePanelRatio should be in register/unregister
Browse files Browse the repository at this point in the history
  • Loading branch information
tintinthong committed Apr 1, 2024
1 parent c7f9640 commit 38b6d90
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,15 @@ export default class ResizablePanelGroup extends Component<Signature> {
collapsible:
context.collapsible == undefined ? true : context.collapsible,
});

this.calculatePanelRatio();
this.onContainerResize();
return id;
}

@action
unregisterPanel(id: number) {
this.listPanelContext.delete(id);
this.calculatePanelRatio();
this.onContainerResize();
}

Expand Down Expand Up @@ -538,7 +539,6 @@ export default class ResizablePanelGroup extends Component<Signature> {

@action
onContainerResize(entry?: ResizeObserverEntry, _observer?: ResizeObserver) {
this.calculatePanelRatio();
if (!this.panelGroupElement) {
if (entry) {
this.panelGroupElement = entry.target as HTMLDivElement;
Expand Down

0 comments on commit 38b6d90

Please sign in to comment.