Skip to content

Commit a85efb5

Browse files
committed
Fix for tabs leaving content behind
sometimes, dynamically created tabs will fail to update the `active` attribute, so inactive tab content is not hidden. explicitly unset the attribute on the old tab and set it on the new tab to prevent this from happening.
1 parent f6a7f06 commit a85efb5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/mm-tabs/mm-tabs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
},
4545

4646
_selectedIndexChanged: function(newIndex, oldIndex) {
47-
if(newIndex !== oldIndex) {
47+
if(this._tabs && newIndex !== oldIndex) {
4848
this.set('_tabs.'+oldIndex+'.active', false);
4949
this.set('_tabs.'+newIndex+'.active', true);
50+
this.attributeFollows('active', this._tabs[newIndex], this._tabs[oldIndex])
5051
}
5152
},
5253

@@ -89,4 +90,4 @@
8990

9091
});
9192

92-
})(window.Strand = window.Strand || {});
93+
})(window.Strand = window.Strand || {});

0 commit comments

Comments
 (0)