Skip to content

Commit

Permalink
Pre-render tabs in accordion mode
Browse files Browse the repository at this point in the history
typo


Don't update fallback selection in accordion mode


Update pkgs


Prevent selecting fallback on invalid selection when the fallback is already selected
  • Loading branch information
megheaiulian authored and nomego committed Aug 15, 2018
1 parent fe7896b commit eae0db2
Show file tree
Hide file tree
Showing 4 changed files with 9,990 additions and 1,025 deletions.
10 changes: 8 additions & 2 deletions cosmoz-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
'_notifyProperty("hidden", hidden)',
'_notifyProperty("disabled", disabled)',
'_notifyProperty("heading", heading)',
'_notifyProperty("badge", badge)'
'_notifyProperty("badge", badge)',
'_onAccordionChangedRender(accordion)'
],

listeners: {
Expand Down Expand Up @@ -123,7 +124,12 @@

resizerShouldBeNotified(resizable) {
return resizable.parentNode !== this.$.header;
}
},

_onAccordionChangedRender(accordion) {
if (accordion) {
this.render();
}
}
});
}());
4 changes: 3 additions & 1 deletion cosmoz-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@
if (item.invalid && item === selected) {
const fallback = this._valueToItem(this.fallbackSelection);
fallback.__invalidFallbackFor = item;
this.select(this.fallbackSelection);
if (fallback !== item) {
this.select(this.fallbackSelection);
}
} else if (!item.invalid && selected && item === selected.__invalidFallbackFor) {
selected.__invalidFallbackFor = null;
this.select(this._valueForItem(item));
Expand Down
Loading

0 comments on commit eae0db2

Please sign in to comment.