Skip to content

fix(docs): make isFocusTrapEnabled internal, removing it from docs #7298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cdk/a11y/focus-trap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -172,7 +172,7 @@ class SimpleFocusTrap {

@Component({
template: `
<div *ngIf="renderFocusTrap" [cdkTrapFocus]="isFocusTrapEnabled">
<div *ngIf="renderFocusTrap" [cdkTrapFocus]="_isFocusTrapEnabled">
<input>
<button>SAVE</button>
</div>
Expand All @@ -181,7 +181,7 @@ class SimpleFocusTrap {
class FocusTrapWithBindings {
@ViewChild(FocusTrapDirective) focusTrapDirective: FocusTrapDirective;
renderFocusTrap = true;
isFocusTrapEnabled = true;
_isFocusTrapEnabled = true;
}


Expand Down
8 changes: 4 additions & 4 deletions src/lib/sidenav/drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class MdDrawer 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';
}
Expand All @@ -224,7 +224,7 @@ export class MdDrawer implements AfterContentInit, OnDestroy {
this._elementFocusedBeforeDrawerWasOpened = this._doc.activeElement as HTMLElement;
}

if (this.isFocusTrapEnabled && this._focusTrap) {
if (this._isFocusTrapEnabled && this._focusTrap) {
this._focusTrap.focusInitialElementWhenReady();
}
});
Expand All @@ -251,7 +251,7 @@ export class MdDrawer 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;
}

Expand Down Expand Up @@ -301,7 +301,7 @@ export class MdDrawer implements AfterContentInit, OnDestroy {
});

if (this._focusTrap) {
this._focusTrap.enabled = this.isFocusTrapEnabled;
this._focusTrap.enabled = this._isFocusTrapEnabled;
}
}

Expand Down