@@ -46,6 +46,7 @@ import {
46
46
import { merge , of as observableOf , Subject } from 'rxjs' ;
47
47
import { takeUntil } from 'rxjs/operators' ;
48
48
import { MatInkBar } from '../ink-bar' ;
49
+ import { FocusMonitor } from '@angular/cdk/a11y' ;
49
50
50
51
51
52
// Boilerplate for applying mixins to MatTabNav.
@@ -222,7 +223,12 @@ export class MatTabLink extends _MatTabLinkMixinBase
222
223
ngZone : NgZone ,
223
224
platform : Platform ,
224
225
@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 ) {
226
232
super ( ) ;
227
233
228
234
this . _tabLinkRipple = new RippleRenderer ( this , ngZone , _elementRef , platform ) ;
@@ -239,10 +245,18 @@ export class MatTabLink extends _MatTabLinkMixinBase
239
245
animation : globalOptions . animation ,
240
246
} ;
241
247
}
248
+
249
+ if ( _focusMonitor ) {
250
+ _focusMonitor . monitor ( _elementRef . nativeElement ) ;
251
+ }
242
252
}
243
253
244
254
ngOnDestroy ( ) {
245
255
this . _tabLinkRipple . _removeTriggerEvents ( ) ;
256
+
257
+ if ( this . _focusMonitor ) {
258
+ this . _focusMonitor . stopMonitoring ( this . _elementRef . nativeElement ) ;
259
+ }
246
260
}
247
261
248
262
/**
0 commit comments