Skip to content

Commit 8780720

Browse files
crisbetoandrewseguin
authored andcommitted
chore(focus-trap): move template to a separate file (#1772)
Moves the focus trap to a separate file, as per a TODO.
1 parent fc30d4c commit 8780720

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/lib/core/a11y/focus-trap.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div tabindex="0" (focus)="focusLastTabbableElement()"></div>
2+
<div #trappedContent><ng-content></ng-content></div>
3+
<div tabindex="0" (focus)="focusFirstTabbableElement()"></div>

src/lib/core/a11y/focus-trap.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ import {InteractivityChecker} from './interactivity-checker';
1313
@Component({
1414
moduleId: module.id,
1515
selector: 'focus-trap',
16-
// TODO(jelbourn): move this to a separate file.
17-
template: `
18-
<div tabindex="0" (focus)="focusLastTabbableElement()"></div>
19-
<div #trappedContent><ng-content></ng-content></div>
20-
<div tabindex="0" (focus)="focusFirstTabbableElement()"></div>`,
16+
templateUrl: 'focus-trap.html',
2117
encapsulation: ViewEncapsulation.None,
2218
})
2319
export class FocusTrap {

0 commit comments

Comments
 (0)