Opened 11 years ago

Last modified 11 years ago

#10727 closed defect

ScrollingTabContainer: tab click calls selectChild twice — at Version 1

Reported by: Adam Peller Owned by: Shane O'Sullivan
Priority: high Milestone: 1.4.2
Component: Dijit Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

In test_TabContainer, click on any tab to select a new tab. If you put a log in selectChild, you'll see it gets called twice. While it should not be catastrophic, some apps may not be expecting this condition and it can cause regressions. Thanks to Phil Berkland @ IBM for spotting this.

StackController.onButtonClick calls container.selectChild. That publishes an event which triggers onButtonClick a second time via ScrollingTabController.onSelectChild:280

tab.onClick(null);

Change History (1)

comment:1 Changed 11 years ago by bill

Description: modified (diff)
Owner: set to Shane O'Sullivan
Summary: ScrollingTabContainer tab click calls selectChild twiceScrollingTabContainer: tab click calls selectChild twice

Shane, do we need the tab.onClick() calls in ScrollingTabController.onSelectChild()? They don't seem appropriate.

I tried commenting them out and then running:

dijit.byId("mainTabContainer").selectChild(dijit.byId("tab2"))
dijit.byId("mainTabContainer").selectChild(dijit.byId("tab1"))

from firebug, it seems to work.

Obviously the checked (aka selected) state of the TabButton's needs to change, so that the selected tab is white, but that's handled in StackController.onSelectChild().

Note: See TracTickets for help on using tickets.