@@ -146,19 +146,6 @@ export class Nav implements NavOutlet {
146146 this . destroyed = false ;
147147 }
148148
149- /**
150- * Blur the active element before any transition between pages
151- * to prevent a11y issues since active element could be kept inside
152- * an element that will be set with aria-hidden="true" and/or inert
153- * which makes the element non-interactive.
154- */
155- blurActiveElement ( ) {
156- const activeElement = document . activeElement as HTMLElement | null ;
157- if ( activeElement ) {
158- activeElement . blur ( ) ;
159- }
160- }
161-
162149 disconnectedCallback ( ) {
163150 for ( const view of this . views ) {
164151 lifecycle ( view . element ! , LIFECYCLE_WILL_UNLOAD ) ;
@@ -192,7 +179,6 @@ export class Nav implements NavOutlet {
192179 opts ?: NavOptions | null ,
193180 done ?: TransitionDoneFn
194181 ) : Promise < boolean > {
195- this . blurActiveElement ( ) ;
196182 return this . insert ( - 1 , component , componentProps , opts , done ) ;
197183 }
198184
@@ -214,7 +200,6 @@ export class Nav implements NavOutlet {
214200 opts ?: NavOptions | null ,
215201 done ?: TransitionDoneFn
216202 ) : Promise < boolean > {
217- this . blurActiveElement ( ) ;
218203 return this . insertPages ( insertIndex , [ { component, componentProps } ] , opts , done ) ;
219204 }
220205
@@ -254,7 +239,6 @@ export class Nav implements NavOutlet {
254239 */
255240 @Method ( )
256241 pop ( opts ?: NavOptions | null , done ?: TransitionDoneFn ) : Promise < boolean > {
257- this . blurActiveElement ( ) ;
258242 return this . removeIndex ( - 1 , 1 , opts , done ) ;
259243 }
260244
@@ -289,7 +273,6 @@ export class Nav implements NavOutlet {
289273 */
290274 @Method ( )
291275 popToRoot ( opts ?: NavOptions | null , done ?: TransitionDoneFn ) : Promise < boolean > {
292- this . blurActiveElement ( ) ;
293276 return this . removeIndex ( 1 , - 1 , opts , done ) ;
294277 }
295278
@@ -333,7 +316,6 @@ export class Nav implements NavOutlet {
333316 opts ?: NavOptions | null ,
334317 done ?: TransitionDoneFn
335318 ) : Promise < boolean > {
336- this . blurActiveElement ( ) ;
337319 return this . setPages ( [ { component, componentProps } ] , opts , done ) ;
338320 }
339321
@@ -532,8 +514,6 @@ export class Nav implements NavOutlet {
532514 * @returns Whether the transition succeeds.
533515 */
534516 private async queueTrns ( ti : TransitionInstruction , done : TransitionDoneFn | undefined ) : Promise < boolean > {
535- this . blurActiveElement ( ) ;
536-
537517 if ( this . isTransitioning && ti . opts ?. skipIfBusy ) {
538518 return false ;
539519 }
0 commit comments