Skip to content

Commit

Permalink
fix previousPage when some tabs have bigger width than canvas size
Browse files Browse the repository at this point in the history
  • Loading branch information
panthony committed Jan 14, 2019
1 parent a17246c commit 2476826
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/components/paper-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ export default Component.extend(ParentMixin, ColorMixin, {
actions: {
previousPage() {
let tab = this.get('childComponents').find((t) => {
return t.get('left') >= this.get('currentOffset');
// ensure we are no stuck because of a tab with a width > canvasWidth
return (t.get('left') + t.get('width')) >= this.get('currentOffset');
});
if (tab) {
let left = Math.max(0, tab.get('left') - this.get('canvasWidth'));
Expand Down

0 comments on commit 2476826

Please sign in to comment.