dojo / dojo/dijit

StackContainer does not update selectedChildWidget properly when all tabs are removed

Open
#190 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.