Skip to content

Commit

Permalink
fix(module: tabs): fix tabs calculate lose precision (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuonuoge committed Apr 15, 2020
1 parent 6b27539 commit c1fc617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/tabs/default-tab-bar.component.ts
Expand Up @@ -254,9 +254,9 @@ export class DefaultTabBarComponent implements AfterContentInit {
}
} else if ((this.selectedKey + 1) * swipingItemLength >= viewportLength - this.tabBarNavSwipedPosition) {
if (this.tabTitles.length - 1 === this.selectedKey) {
this.tabBarNavSwipedPosition = viewportLength - (this.selectedKey + 1) * swipingItemLength;
this.tabBarNavSwipedPosition = (viewportLength / swipingItemLength - this.selectedKey - 1) * swipingItemLength;
} else {
this.tabBarNavSwipedPosition = viewportLength - (this.selectedKey + 2) * swipingItemLength;
this.tabBarNavSwipedPosition = (viewportLength / swipingItemLength - this.selectedKey - 2) * swipingItemLength;
}
}
if (this.tabBarNavSwipedPosition < 0) {
Expand Down

0 comments on commit c1fc617

Please sign in to comment.