@@ -141,7 +141,7 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
141
141
private _disableClear : boolean ;
142
142
143
143
constructor ( public _intl : MatSortHeaderIntl ,
144
- changeDetectorRef : ChangeDetectorRef ,
144
+ private _changeDetectorRef : ChangeDetectorRef ,
145
145
// `MatSort` is not optionally injected, but just asserted manually w/ better error.
146
146
// tslint:disable-next-line: lightweight-tokens
147
147
@Optional ( ) public _sort : MatSort ,
@@ -171,7 +171,7 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
171
171
this . _setAnimationTransitionState ( { fromState : 'active' , toState : this . _arrowDirection } ) ;
172
172
}
173
173
174
- changeDetectorRef . markForCheck ( ) ;
174
+ _changeDetectorRef . markForCheck ( ) ;
175
175
} ) ;
176
176
}
177
177
@@ -191,8 +191,13 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
191
191
ngAfterViewInit ( ) {
192
192
// We use the focus monitor because we also want to style
193
193
// things differently based on the focus origin.
194
- this . _focusMonitor . monitor ( this . _elementRef , true )
195
- . subscribe ( origin => this . _setIndicatorHintVisible ( ! ! origin ) ) ;
194
+ this . _focusMonitor . monitor ( this . _elementRef , true ) . subscribe ( origin => {
195
+ const newState = ! ! origin ;
196
+ if ( newState !== this . _showIndicatorHint ) {
197
+ this . _setIndicatorHintVisible ( newState ) ;
198
+ this . _changeDetectorRef . markForCheck ( ) ;
199
+ }
200
+ } ) ;
196
201
}
197
202
198
203
ngOnDestroy ( ) {
0 commit comments