StackContainer does not update selectedChildWidget properly when all tabs are removed
- Dominant language
- HTML
- Stars
- 172
- Forks
- 180
- PR merge metrics
- No merged PRs in 30d
Description
The recommended way to listen to selected tab change is
```js
myTabContainer.watch("selectedChildWidget", function(name, oval, nval){
console.log("selected child changed from ", oval, " to ", nval);
});
```
see https://dojotoolkit.org/reference-guide/1.10/dijit/layout/TabContainer.html#tabcontainer-events
It works for `TabContainer.addChild` and `TabContainer.removeChild`, too. However, then `TabContainer.removeChild` removes the last selected tab, then the `watch` event is not fired, but the `selectedChildWidget` is set to `undefined`, see https://github.com/dojo/dijit/blob/master/layout/StackContainer.js#L204 I would like `selectedChildWidget` to set properly even when the last tab is removed.
Contributor guide
Assessment
This issue has not been assessed yet.