Skip to content

Commit

Permalink
Fix bug where DashContainerModel.addView would throw when adding a …
Browse files Browse the repository at this point in the history
…view to a row or column (#3489)
  • Loading branch information
ghsolomon authored Sep 28, 2023
1 parent 19e2118 commit c2bcc95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 60.0.0-SNAPSHOT - unreleased

### 🐞 Bug Fixes

* Fix bug where `DashContainerModel.addView` would throw when adding a view to a row or column

## 59.1.0 - 2023-09-20

### 🎁 New Features
Expand Down
5 changes: 3 additions & 2 deletions desktop/cmp/dash/container/DashContainerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {wait} from '@xh/hoist/promise';
import {isOmitted} from '@xh/hoist/utils/impl';
import {debounced, ensureUniqueBy, throwIf} from '@xh/hoist/utils/js';
import {createObservableRef} from '@xh/hoist/utils/react';
import {cloneDeep, defaultsDeep, find, isFinite, isNil, reject, startCase} from 'lodash';
import {cloneDeep, defaultsDeep, find, isFinite, isNil, last, reject, startCase} from 'lodash';
import {createRoot} from 'react-dom/client';
import {DashConfig, DashModel} from '../';
import {DashViewModel, DashViewState} from '../DashViewModel';
Expand Down Expand Up @@ -290,7 +290,8 @@ export class DashContainerModel extends DashModel<

if (!isFinite(index)) index = container.contentItems.length;
container.addChild(goldenLayoutConfig(viewSpec), index);
wait(1).then(() => this.onStackActiveItemChange(container));
const stack = container.isStack ? container : last(container.contentItems);
wait(1).then(() => this.onStackActiveItemChange(stack));
}

/**
Expand Down

0 comments on commit c2bcc95

Please sign in to comment.