File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,11 @@ export class FocusTrap {
72
72
}
73
73
74
74
this . _ngZone . runOutsideAngular ( ( ) => {
75
- this . _element
76
- . insertAdjacentElement ( 'beforebegin' , this . _startAnchor )
77
- . addEventListener ( 'focus' , ( ) => this . focusLastTabbableElement ( ) ) ;
75
+ this . _startAnchor . addEventListener ( 'focus' , ( ) => this . focusLastTabbableElement ( ) ) ;
76
+ this . _endAnchor . addEventListener ( 'focus' , ( ) => this . focusFirstTabbableElement ( ) ) ;
78
77
79
- this . _element
80
- . insertAdjacentElement ( 'afterend' , this . _endAnchor )
81
- . addEventListener ( 'focus' , ( ) => this . focusFirstTabbableElement ( ) ) ;
78
+ this . _element . parentNode . insertBefore ( this . _startAnchor , this . _element ) ;
79
+ this . _element . parentNode . insertBefore ( this . _endAnchor , this . _element . nextSibling ) ;
82
80
} ) ;
83
81
}
84
82
You can’t perform that action at this time.
0 commit comments