Ext version tested:
  • Ext 3.2 rev 1

Adapter used:
  • ext

css used:
  • only default ext-all.css

Browser versions tested against:
  • IE8

Operating System:
  • Windows Vista Ultimate

Description:
  • Ext.TabPanel.setActiveTab calls CardLayout.setActiveItem but does not check the return value. CardLayout.setActiveItem can return false if the active Panel could not be hidden. TabPanel therefore permits changing tabs when CardLayout has not changed the active item.

Test Case:
Code:
 Ext.onReady(function() {
    new Ext.Viewport({
        items:[{
            xtype:'tabpanel',
            activeTab:0,
            items:[{
                html:'<h1>Tab1 HTML contents</h1>',
                title:'Tab1',
                listeners:{
                    beforehide:function() {
                        return false;
                    }
                }
            },{
                html:'<h1>Tab2 HTML contents</h1>',
                title:'Tab2'
            }]
        }],
        layout:'fit'
    });
});
Steps to reproduce the problem:
  • Run code example
  • Click Tab2
  • Observe that the tab change is allowed but Tab1's contents are still displayed

The result that was expected:
  • Tab should not be allowed to change

The result that occurs instead:
  • Tab is allowed to change

Possible fix:
  • Check return value of this.layout.setActiveItem(item); in TabPanel.setActiveTab