@@ -147,7 +147,7 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
147
147
ngAfterContentChecked ( ) : void {
148
148
// If the number of tab labels have changed, check if scrolling should be enabled
149
149
if ( this . _tabLabelCount != this . _labelWrappers . length ) {
150
- this . _updatePagination ( ) ;
150
+ this . updatePagination ( ) ;
151
151
this . _tabLabelCount = this . _labelWrappers . length ;
152
152
this . _changeDetectorRef . markForCheck ( ) ;
153
153
}
@@ -198,7 +198,7 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
198
198
const dirChange = this . _dir ? this . _dir . change : observableOf ( null ) ;
199
199
const resize = this . _viewportRuler . change ( 150 ) ;
200
200
const realign = ( ) => {
201
- this . _updatePagination ( ) ;
201
+ this . updatePagination ( ) ;
202
202
this . _alignInkBarToSelectedTab ( ) ;
203
203
} ;
204
204
@@ -238,7 +238,7 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
238
238
*/
239
239
_onContentChanges ( ) {
240
240
const zoneCallback = ( ) => {
241
- this . _updatePagination ( ) ;
241
+ this . updatePagination ( ) ;
242
242
this . _alignInkBarToSelectedTab ( ) ;
243
243
this . _changeDetectorRef . markForCheck ( ) ;
244
244
} ;
@@ -250,9 +250,13 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
250
250
}
251
251
252
252
/**
253
- * Updating the view whether pagination should be enabled or not
253
+ * Updates the view whether pagination should be enabled or not.
254
+ *
255
+ * WARNING: Calling this method can be very costly in terms of performance. It should be called
256
+ * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
257
+ * page.
254
258
*/
255
- _updatePagination ( ) {
259
+ updatePagination ( ) {
256
260
this . _checkPaginationEnabled ( ) ;
257
261
this . _checkScrollingControls ( ) ;
258
262
this . _updateTabScrollPosition ( ) ;
0 commit comments