Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 3410650

Browse files
fix(tabs): Tab pagination/selection now works properly on iOS
Closes #220 Closes #231
1 parent a0f5f66 commit 3410650

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src/components/tabs/js/pagination.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function linkTabPagination(scope, element, tabsCtrl, $q, $materialEffects ) {
6666
// before we announce status [and potentially update focus]
6767

6868
if ( pageChange ) {
69+
6970
tabsHeader.one($materialEffects.TRANSITIONEND_EVENT, function() {
7071
dfd.resolve(pageIndex);
7172
});
@@ -107,22 +108,14 @@ function linkTabPagination(scope, element, tabsCtrl, $q, $materialEffects ) {
107108
if ( page < 0 ) page = 0;
108109
if ( page > lastPage ) page = lastPage;
109110

111+
pagination.page = page;
112+
110113
pagination.startIndex = !pagination.active ? 0 : page * pagination.itemsPerPage;
111114
pagination.endIndex = !pagination.active ? lastTab : pagination.startIndex + pagination.itemsPerPage - 1;
112115
pagination.hasPrev = !pagination.active ? false : page > 0;
113116
pagination.hasNext = !pagination.active ? false : (page + 1) < pagination.pagesCount;
114117

115118
slideTabButtons( -page * pagination.itemsPerPage * pagination.tabWidth );
116-
117-
if ( (updateTabSelection !== false) && !isTabInRange(scope.$selIndex) ) {
118-
var index = (page > pagination.page) ? pagination.startIndex : pagination.endIndex;
119-
120-
// Only change selected tab IF the current tab is not `in range`
121-
tabsCtrl.selectAt( index );
122-
}
123-
124-
pagination.page = page;
125-
126119
}
127120

128121
/**

0 commit comments

Comments
 (0)