Skip to content

Commit

Permalink
chore(focus-trap): move template to a separate file (#1772)
Browse files Browse the repository at this point in the history
Moves the focus trap to a separate file, as per a TODO.
  • Loading branch information
crisbeto authored and andrewseguin committed Nov 22, 2016
1 parent fc30d4c commit 8780720
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/lib/core/a11y/focus-trap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div tabindex="0" (focus)="focusLastTabbableElement()"></div>
<div #trappedContent><ng-content></ng-content></div>
<div tabindex="0" (focus)="focusFirstTabbableElement()"></div>
6 changes: 1 addition & 5 deletions src/lib/core/a11y/focus-trap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ import {InteractivityChecker} from './interactivity-checker';
@Component({
moduleId: module.id,
selector: 'focus-trap',
// TODO(jelbourn): move this to a separate file.
template: `
<div tabindex="0" (focus)="focusLastTabbableElement()"></div>
<div #trappedContent><ng-content></ng-content></div>
<div tabindex="0" (focus)="focusFirstTabbableElement()"></div>`,
templateUrl: 'focus-trap.html',
encapsulation: ViewEncapsulation.None,
})
export class FocusTrap {
Expand Down

0 comments on commit 8780720

Please sign in to comment.