You found a bug! We've classified it as
EXTJS-24491
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
[6.2.1] Later enabled active card doesn't have the tab highlighted
In a tabpanel, should an active card which is initially disabled and later enabled have the tab highlighted ? I think yes. Because when enabling or disabling a card, the tab highlighter is not removed, which if to consider current scenario, then would mean to have inconsistency in the code, and more than this in order to highlight the tab is needed to deactivate and then activate it back.
So when the tabpanel is initialized, the first card was configured as active and disabled at the same time.
The highlight is skiped becuase of the tab.disabled check:
Code:
setActiveTab: function(tab, initial) {
var me = this;
if (!tab.disabled && tab !== me.activeTab) {
Later when enabled, the tab is not highlighted because the setActiveTab returns earlier.
Code:
setActiveTab: function(card) {
var me = this,
previous;
// Check for a config object
if (!Ext.isObject(card) || card.isComponent) {
card = me.getComponent(card);
}
previous = me.getActiveTab();
if (card) {
Ext.suspendLayouts();
// We may be passed a config object, so add it.
// Without doing a layout!
if (!card.isComponent) {
card = me.add(card);
}
//THE PREVIOUS IS THE SAME AS CARD, SO RETURNS WITHOUT HIGHLIGHTING THE TAB
if (previous === card || me.fireEvent('beforetabchange', me, card, previous) === false) {
Ext.resumeLayouts(true);
return previous;
}
https://fiddle.sencha.com/#view/editor&fiddle/1lu9
-
Thanks for the report! I have opened a bug in our bug tracker.