@@ -46,6 +46,7 @@ import {
4646import { merge , of as observableOf , Subject } from 'rxjs' ;
4747import { takeUntil } from 'rxjs/operators' ;
4848import { MatInkBar } from '../ink-bar' ;
49+ import { FocusMonitor } from '@angular/cdk/a11y' ;
4950
5051
5152// Boilerplate for applying mixins to MatTabNav.
@@ -222,7 +223,12 @@ export class MatTabLink extends _MatTabLinkMixinBase
222223 ngZone : NgZone ,
223224 platform : Platform ,
224225 @Optional ( ) @Inject ( MAT_RIPPLE_GLOBAL_OPTIONS ) globalOptions : RippleGlobalOptions ,
225- @Attribute ( 'tabindex' ) tabIndex : string ) {
226+ @Attribute ( 'tabindex' ) tabIndex : string ,
227+ /**
228+ * @deprecated
229+ * @deletion -target 7.0.0 `_focusMonitor` parameter to be made required.
230+ */
231+ private _focusMonitor ?: FocusMonitor ) {
226232 super ( ) ;
227233
228234 this . _tabLinkRipple = new RippleRenderer ( this , ngZone , _elementRef , platform ) ;
@@ -239,10 +245,18 @@ export class MatTabLink extends _MatTabLinkMixinBase
239245 animation : globalOptions . animation ,
240246 } ;
241247 }
248+
249+ if ( _focusMonitor ) {
250+ _focusMonitor . monitor ( _elementRef . nativeElement ) ;
251+ }
242252 }
243253
244254 ngOnDestroy ( ) {
245255 this . _tabLinkRipple . _removeTriggerEvents ( ) ;
256+
257+ if ( this . _focusMonitor ) {
258+ this . _focusMonitor . stopMonitoring ( this . _elementRef . nativeElement ) ;
259+ }
246260 }
247261
248262 /**
0 commit comments