Make isFocusTrapEnabled internal, removing it from docs. (#7298)

BREAKING CHANGE: `isFocusTrapEnabled` is now properly marked internal.
This commit is contained in:
Joey Perrott
2017-09-29 13:03:44 -07:00
committed by Andrew Seguin
parent fe0864b8a9
commit ce6cc0bb78
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -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: `
<div *ngIf="renderFocusTrap" [cdkTrapFocus]="isFocusTrapEnabled">
<div *ngIf="renderFocusTrap" [cdkTrapFocus]="_isFocusTrapEnabled">
<input>
<button>SAVE</button>
</div>
@@ -181,7 +181,7 @@ class SimpleFocusTrap {
class FocusTrapWithBindings {
@ViewChild(FocusTrapDirective) focusTrapDirective: FocusTrapDirective;
renderFocusTrap = true;
isFocusTrapEnabled = true;
_isFocusTrapEnabled = true;
}
+4 -4
View File
@@ -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;
}
}