Skip to content

StackContainer does not update selectedChildWidget properly when all tabs are removed #190

@xmedeko

Description

@xmedeko

The recommended way to listen to selected tab change is

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions