@@ -2834,20 +2834,27 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
28342834 } ,
28352835 exec_focus ( e , eventType , phxEvent , view , sourceEl , el ) {
28362836 aria_default . attemptFocus ( el ) ;
2837+ window . requestAnimationFrame ( ( ) => {
2838+ window . requestAnimationFrame ( ( ) => aria_default . attemptFocus ( el ) ) ;
2839+ } ) ;
28372840 } ,
28382841 exec_focus_first ( e , eventType , phxEvent , view , sourceEl , el ) {
28392842 aria_default . focusFirstInteractive ( el ) || aria_default . focusFirst ( el ) ;
2843+ window . requestAnimationFrame ( ( ) => {
2844+ window . requestAnimationFrame ( ( ) => aria_default . focusFirstInteractive ( el ) || aria_default . focusFirst ( el ) ) ;
2845+ } ) ;
28402846 } ,
28412847 exec_push_focus ( e , eventType , phxEvent , view , sourceEl , el ) {
2842- window . requestAnimationFrame ( ( ) => focusStack . push ( el || sourceEl ) ) ;
2848+ focusStack . push ( el || sourceEl ) ;
28432849 } ,
28442850 exec_pop_focus ( _e , _eventType , _phxEvent , _view , _sourceEl , _el ) {
2845- window . requestAnimationFrame ( ( ) => {
2846- const el = focusStack . pop ( ) ;
2847- if ( el ) {
2848- el . focus ( ) ;
2849- }
2850- } ) ;
2851+ const el = focusStack . pop ( ) ;
2852+ if ( el ) {
2853+ el . focus ( ) ;
2854+ window . requestAnimationFrame ( ( ) => {
2855+ window . requestAnimationFrame ( ( ) => el . focus ( ) ) ;
2856+ } ) ;
2857+ }
28512858 } ,
28522859 exec_add_class ( e , eventType , phxEvent , view , sourceEl , el , { names, transition, time, blocking } ) {
28532860 this . addOrRemoveClasses ( el , names , [ ] , transition , time , view , blocking ) ;
@@ -2921,11 +2928,13 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
29212928 }
29222929 let onStart = ( ) => {
29232930 this . addOrRemoveClasses ( el , inStartClasses , outClasses . concat ( outStartClasses ) . concat ( outEndClasses ) ) ;
2924- let stickyDisplay = display || this . defaultDisplay ( el ) ;
2925- dom_default . putSticky ( el , "toggle" , ( currentEl ) => currentEl . style . display = stickyDisplay ) ;
2931+ const stickyDisplay = display || this . defaultDisplay ( el ) ;
29262932 window . requestAnimationFrame ( ( ) => {
29272933 this . addOrRemoveClasses ( el , inClasses , [ ] ) ;
2928- window . requestAnimationFrame ( ( ) => this . addOrRemoveClasses ( el , inEndClasses , inStartClasses ) ) ;
2934+ window . requestAnimationFrame ( ( ) => {
2935+ dom_default . putSticky ( el , "toggle" , ( currentEl ) => currentEl . style . display = stickyDisplay ) ;
2936+ this . addOrRemoveClasses ( el , inEndClasses , inStartClasses ) ;
2937+ } ) ;
29292938 } ) ;
29302939 } ;
29312940 let onEnd = ( ) => {
@@ -2942,14 +2951,18 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
29422951 }
29432952 } else {
29442953 if ( this . isVisible ( el ) ) {
2945- el . dispatchEvent ( new Event ( "phx:hide-start" ) ) ;
2946- dom_default . putSticky ( el , "toggle" , ( currentEl ) => currentEl . style . display = "none" ) ;
2947- el . dispatchEvent ( new Event ( "phx:hide-end" ) ) ;
2954+ window . requestAnimationFrame ( ( ) => {
2955+ el . dispatchEvent ( new Event ( "phx:hide-start" ) ) ;
2956+ dom_default . putSticky ( el , "toggle" , ( currentEl ) => currentEl . style . display = "none" ) ;
2957+ el . dispatchEvent ( new Event ( "phx:hide-end" ) ) ;
2958+ } ) ;
29482959 } else {
2949- el . dispatchEvent ( new Event ( "phx:show-start" ) ) ;
2950- let stickyDisplay = display || this . defaultDisplay ( el ) ;
2951- dom_default . putSticky ( el , "toggle" , ( currentEl ) => currentEl . style . display = stickyDisplay ) ;
2952- el . dispatchEvent ( new Event ( "phx:show-end" ) ) ;
2960+ window . requestAnimationFrame ( ( ) => {
2961+ el . dispatchEvent ( new Event ( "phx:show-start" ) ) ;
2962+ let stickyDisplay = display || this . defaultDisplay ( el ) ;
2963+ dom_default . putSticky ( el , "toggle" , ( currentEl ) => currentEl . style . display = stickyDisplay ) ;
2964+ el . dispatchEvent ( new Event ( "phx:show-end" ) ) ;
2965+ } ) ;
29532966 }
29542967 }
29552968 } ,
0 commit comments