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 {
7272 }
7373
7474 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 ( ) ) ;
7877
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 ) ;
8280 } ) ;
8381 }
8482
You can’t perform that action at this time.
0 commit comments