diff --git a/src/cdk/a11y/focus-trap.spec.ts b/src/cdk/a11y/focus-trap.spec.ts
index 4ccae568849..debc77a138f 100644
--- a/src/cdk/a11y/focus-trap.spec.ts
+++ b/src/cdk/a11y/focus-trap.spec.ts
@@ -103,7 +103,7 @@ describe('FocusTrap', () => {
expect(anchors.every(current => current.getAttribute('tabindex') === '0')).toBe(true);
- fixture.componentInstance.isFocusTrapEnabled = false;
+ fixture.componentInstance._isFocusTrapEnabled = false;
fixture.detectChanges();
expect(anchors.every(current => current.getAttribute('tabindex') === '-1')).toBe(true);
@@ -172,7 +172,7 @@ class SimpleFocusTrap {
@Component({
template: `
-
+
@@ -181,7 +181,7 @@ class SimpleFocusTrap {
class FocusTrapWithBindings {
@ViewChild(FocusTrapDirective) focusTrapDirective: FocusTrapDirective;
renderFocusTrap = true;
- isFocusTrapEnabled = true;
+ _isFocusTrapEnabled = true;
}
diff --git a/src/lib/sidenav/drawer.ts b/src/lib/sidenav/drawer.ts
index 9cf024098eb..deb90d49abb 100644
--- a/src/lib/sidenav/drawer.ts
+++ b/src/lib/sidenav/drawer.ts
@@ -211,7 +211,7 @@ export class MatDrawer implements AfterContentInit, OnDestroy {
*/
_modeChanged = new Subject();
- get isFocusTrapEnabled() {
+ get _isFocusTrapEnabled() {
// The focus trap is only enabled when the drawer is open in any mode other than side.
return this.opened && this.mode !== 'side';
}
@@ -224,7 +224,7 @@ export class MatDrawer implements AfterContentInit, OnDestroy {
this._elementFocusedBeforeDrawerWasOpened = this._doc.activeElement as HTMLElement;
}
- if (this.isFocusTrapEnabled && this._focusTrap) {
+ if (this._isFocusTrapEnabled && this._focusTrap) {
this._focusTrap.focusInitialElementWhenReady();
}
});
@@ -251,7 +251,7 @@ export class MatDrawer implements AfterContentInit, OnDestroy {
ngAfterContentInit() {
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
- this._focusTrap.enabled = this.isFocusTrapEnabled;
+ this._focusTrap.enabled = this._isFocusTrapEnabled;
this._enableAnimations = true;
}
@@ -301,7 +301,7 @@ export class MatDrawer implements AfterContentInit, OnDestroy {
});
if (this._focusTrap) {
- this._focusTrap.enabled = this.isFocusTrapEnabled;
+ this._focusTrap.enabled = this._isFocusTrapEnabled;
}
}